Changeset 35212


Ignore:
Timestamp:
2021-06-08T16:34:16+12:00 (8 days ago)
Author:
davidb
Message:

More careful processing of 'position' to array index

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/mars-src/trunk/src/wavesurfer-renderer/drawer.spectrummulticanvas.js

    r35193 r35212  
    699699    }
    700700   
     701    var floor_position = Math.floor(position);
     702
    701703    if (this.params.renderWave == 1) {
    702704        super.updateProgress(position);
     
    709711        //console.log(this);
    710712
    711         var norm_arousal_val = this.norm_arousal_progress_timeline[position];
    712         var norm_valence_val = this.norm_valence_progress_timeline[position];
     713        var norm_arousal_val = this.norm_arousal_progress_timeline[floor_position];
     714        var norm_valence_val = this.norm_valence_progress_timeline[floor_position];
    713715
    714716        // ****
    715         //console.log("position = " + position + ", arousal = " + arousal_val + ", valence = " + valence_val);
     717        //console.log("floor_position = " + floor_position + ", arousal = " + arousal_val + ", valence = " + valence_val);
    716718       
    717719        // shift [-1,1] scale
     
    738740    }
    739741
    740     var arousal_val = this.arousal_progress_timeline[position];
    741     var valence_val = this.valence_progress_timeline[position];
     742    var arousal_val = this.arousal_progress_timeline[floor_position];
     743    var valence_val = this.valence_progress_timeline[floor_position];
     744
     745    //console.log("*** arousal_val [" + floor_position + "]" + " = " + arousal_val);
    742746
    743747    var arousal_val_3dp = Math.round(arousal_val*1000)/1000;
Note: See TracChangeset for help on using the changeset viewer.