Changeset 58 in tmcsimulator-scriptbuilder for trunk


Ignore:
Timestamp:
08/14/2017 03:25:59 PM (9 years ago)
Author:
bmcguffin
Message:

Updated setOffset() method to actually shift timeslices. Changed scope of updateLenth(), both for testing purposes and to ensure length is always accurate.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scriptbuilder/structures/ScriptIncident.java

    r56 r58  
    155155    public void setOffset(int offset) 
    156156    { 
     157        int old = this.offset; 
    157158        this.offset = offset; 
     159 
     160        for (TimeSlice ts : slices.values()) 
     161        { 
     162            ts.shift(offset - old); 
     163        } 
     164 
    158165        script.update(); 
    159166    } 
     
    267274     * that the latest, longest-lasting event ends, minus the offset. 
    268275     */ 
    269     private void updateLength() 
     276    public void updateLength() 
    270277    { 
    271278        int lengthSoFar = 0; 
Note: See TracChangeset for help on using the changeset viewer.