hdpi: fix rendering issue with horizontal sliders and vertical inputs

This commit is contained in:
jean-emmanuel 2018-01-28 18:26:54 +01:00
parent c3f361f110
commit 275bdc10a6
2 changed files with 6 additions and 4 deletions

View file

@ -125,12 +125,14 @@ module.exports = class Input extends _canvas_base {
super.resizeHandle(event)
if (this.getProp('vertical')){
this.ctx.setTransform(1, 0, 0, 1, 0, 0)
this.ctx.rotate(-Math.PI/2)
this.ctx.translate(-this.height, 0)
var ratio = CANVAS_SCALING * this.scaling
this.ctx.setTransform(1, 0, 0, 1, 0, 0)
this.ctx.rotate(-Math.PI/2)
this.ctx.translate(-this.height * ratio, 0)
if (ratio != 1) this.ctx.scale(ratio, ratio)
}

View file

@ -183,7 +183,7 @@ module.exports = class Fader extends _sliders_base {
if (this.getProp('horizontal')){
this.ctx.setTransform(1, 0, 0, 1, 0, 0)
this.ctx.rotate(-Math.PI/2)
this.ctx.translate(-this.height, 0)
this.ctx.translate(-this.height * ratio, 0)
if (ratio != 1) this.ctx.scale(ratio, ratio)
}