sliders: fix regression introduced with range widget

This commit is contained in:
jean-emmanuel 2017-12-22 17:47:18 +01:00
parent 9ee38507fd
commit 679f523682
2 changed files with 4 additions and 4 deletions

View file

@ -203,7 +203,7 @@ module.exports = class _sliders_base extends _canvas_base {
this.value = value
this.percent = this.valueToPercent(this.value)
if (!options.dragged) this.percent = this.valueToPercent(this.value)
if (!this.noDraw) this.draw()

View file

@ -142,7 +142,7 @@ module.exports = class Range extends _widgets_base {
for (var i in this.handles) {
if (this.handlesToFaders.indexOf(i) != -1) continue
var coord = this.faders[i].percentToCoord(this.faders[i].percent) - (this.getProp('horizontal') ? -1 : 1) * (i == 0 ? -20 : 20)
var coord = this.faders[i].percentToCoord(this.faders[i].valueToPercent(this.faders[i].value)) - (this.getProp('horizontal') ? -1 : 1) * (i == 0 ? -20 : 20)
ndiff = this.getProp('horizontal')?
Math.abs(data.offsetX - coord) :
@ -224,8 +224,8 @@ module.exports = class Range extends _widgets_base {
var width = this.getProp('horizontal') ? this.height : this.width,
height = !this.getProp('horizontal') ? this.height : this.width
var d = Math.round(this.percentToCoord(_this.faders[this.getProp('horizontal')?0:1].percent)),
d2 = Math.round(this.percentToCoord(_this.faders[this.getProp('horizontal')?1:0].percent)),
var d = Math.round(this.percentToCoord(this.valueToPercent(_this.faders[this.getProp('horizontal')?0:1].value))),
d2 = Math.round(this.percentToCoord(this.valueToPercent(_this.faders[this.getProp('horizontal')?1:0].value))),
m = Math.round(this.getProp('horizontal') ? this.height / 2 : this.width / 2)
var dashed = this.getProp('dashed')