diff --git a/src/client/widgets/common/canvas.js b/src/client/widgets/common/canvas.js index a129c1f0..1c63b371 100644 --- a/src/client/widgets/common/canvas.js +++ b/src/client/widgets/common/canvas.js @@ -66,7 +66,7 @@ class Canvas extends Widget { resizeHandle(event){ - var {width, height, style} = event, + var {width, height, style, preventDraw} = event, ratio = CANVAS_SCALING * this.scaling this.height = height @@ -95,12 +95,14 @@ class Canvas extends Widget { this.ctx.scale(ratio, ratio) } - if (!this.hasSize) { - this.hasSize = true - this.setVisibility() - this.batchDraw() - } else { - this.draw() + if (!preventDraw) { + if (!this.hasSize) { + this.hasSize = true + this.setVisibility() + this.batchDraw() + } else { + this.draw() + } } }) diff --git a/src/client/widgets/sliders/fader.js b/src/client/widgets/sliders/fader.js index 57854cc7..3abfd07b 100644 --- a/src/client/widgets/sliders/fader.js +++ b/src/client/widgets/sliders/fader.js @@ -117,6 +117,8 @@ class Fader extends Slider { var ratio = CANVAS_SCALING * this.scaling + event.preventDraw = true + super.resizeHandle(event) fastdom.mutate(()=>{ @@ -127,6 +129,7 @@ class Fader extends Slider { this.ctx.translate(-this.height * ratio, 0) if (ratio != 1) this.ctx.scale(ratio, ratio) + } if (this.getProp('gradient')) { @@ -166,8 +169,16 @@ class Fader extends Slider { } - }) + if (!this.hasSize) { + this.hasSize = true + this.setVisibility() + this.batchDraw() + } else { + this.draw() + } + + }) }