From fdaff0b47af243a21a693573829b5f3f04b86af4 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 9 Dec 2016 13:43:26 +0100 Subject: [PATCH] fader: draw the track same way as gauge; round their width to avoid blur on zoom --- src/browser/js/app/widgets/sliders/fader.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/browser/js/app/widgets/sliders/fader.js b/src/browser/js/app/widgets/sliders/fader.js index f355acca..e885b877 100644 --- a/src/browser/js/app/widgets/sliders/fader.js +++ b/src/browser/js/app/widgets/sliders/fader.js @@ -202,16 +202,18 @@ Fader.prototype.draw = function(){ } else { + this.ctx.lineWidth = Math.round(2 * PXSCALE) + this.ctx.beginPath() - this.ctx.fillStyle = this.colors.track - this.ctx.rect(this.margin * PXSCALE, m - 1 * PXSCALE, this.width - this.margin * 2 * PXSCALE, 2 * PXSCALE) - this.ctx.fill() + this.ctx.strokeStyle = this.colors.track + this.ctx.moveTo(this.margin * PXSCALE, m) + this.ctx.lineTo(this.width - this.margin * PXSCALE, m ) + this.ctx.stroke() this.ctx.beginPath() this.ctx.strokeStyle = this.colors.gauge this.ctx.moveTo(d + this.margin * PXSCALE, m) this.ctx.lineTo(o + this.margin * PXSCALE, m) - this.ctx.lineWidth = 2 * PXSCALE this.ctx.stroke() this.ctx.fillStyle = this.colors.knob @@ -266,16 +268,18 @@ Fader.prototype.draw = function(){ } else { + this.ctx.lineWidth = Math.round(2 * PXSCALE) + this.ctx.beginPath() - this.ctx.fillStyle = this.colors.track - this.ctx.rect(m - 1 * PXSCALE, this.margin * PXSCALE, 2 * PXSCALE, this.height - this.margin *2 * PXSCALE) - this.ctx.fill() + this.ctx.strokeStyle = this.colors.track + this.ctx.moveTo(m, this.margin * PXSCALE) + this.ctx.lineTo(m, this.height - this.margin * PXSCALE) + this.ctx.stroke() this.ctx.beginPath() this.ctx.strokeStyle = this.colors.gauge this.ctx.moveTo(m, d) this.ctx.lineTo(m, o) - this.ctx.lineWidth = 2 * PXSCALE this.ctx.stroke()