svghmi/widget_scrollbar.ysl2
branchsvghmi
changeset 3137 ac3ec66e9c6d
parent 3136 784c839d4259
child 3138 1d724e8d5592
equal deleted inserted replaced
3136:784c839d4259 3137:ac3ec66e9c6d
    40                 return;
    40                 return;
    41             let [size, maxh, range, pixels, units] = this.get_ratios();
    41             let [size, maxh, range, pixels, units] = this.get_ratios();
    42 
    42 
    43             let new_y = this.range_elt.y.baseVal.value + Math.round(Math.min(this.position,range) * pixels / units);
    43             let new_y = this.range_elt.y.baseVal.value + Math.round(Math.min(this.position,range) * pixels / units);
    44             let new_height = Math.round(maxh * size/range);
    44             let new_height = Math.round(maxh * size/range);
    45             console.log(new_y, new_height);
       
    46 
    45 
    47             this.cursor_elt.y.baseVal.value = new_y;
    46             this.cursor_elt.y.baseVal.value = new_y;
    48             this.cursor_elt.height.baseVal.value = new_height;
    47             this.cursor_elt.height.baseVal.value = new_height;
    49         }
    48         }
    50 
    49