fader: compact hdpi compatibility

This commit is contained in:
jean-emmanuel 2017-07-10 18:10:28 +02:00
parent 07429bd483
commit 720d064a28

View file

@ -161,16 +161,18 @@ module.exports = class Fader extends _sliders_base {
}
resizeHandle(){
super.resizeHandle(...arguments)
resizeHandle(e, width, height, checkColors) {
var ratio = CANVAS_SCALING * this.scaling
if (this.getProp('compact')) {
if (this.getProp('horizontal')) {
this.canvas[0].setAttribute('height', 1)
super.resizeHandle(e, width, 1 / ratio, checkColors)
} else {
this.canvas[0].setAttribute('width', 1)
super.resizeHandle(e, 1 / ratio, height, checkColors)
}
} else {
super.resizeHandle(...arguments)
}
if (this.getProp('horizontal')){
@ -178,8 +180,6 @@ module.exports = class Fader extends _sliders_base {
this.ctx.rotate(-Math.PI/2)
this.ctx.translate(-this.height, 0)
var ratio = CANVAS_SCALING * this.scaling
if (ratio != 1) this.ctx.scale(ratio, ratio)
}