From 11fe06be45ee9ba6ea2db20172c008586d350268 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 16 Nov 2016 21:50:00 +0100 Subject: [PATCH] fader compact pips: back to text color only --- src/browser/js/app/widgets/sliders/fader.js | 81 +++++++++------------ 1 file changed, 36 insertions(+), 45 deletions(-) diff --git a/src/browser/js/app/widgets/sliders/fader.js b/src/browser/js/app/widgets/sliders/fader.js index 1b5caaba..e0e21921 100644 --- a/src/browser/js/app/widgets/sliders/fader.js +++ b/src/browser/js/app/widgets/sliders/fader.js @@ -158,29 +158,6 @@ Fader.prototype.draw = function(){ if (this.widgetData.horizontal) { if (this.widgetData.compact) { - if (!this.widgetData.noPip) { - this.ctx.lineWidth = PXSCALE - this.ctx.globalAlpha = 0.3 - - var x, - min = Math.min(d,o), - max = Math.max(d,o) - - for (var i = 1;i < this.rangeKeys.length - 1;i++) { - x = Math.round(this.percentToCoord(this.rangeKeys[i])) + 0.5 * PXSCALE - if (x < max && x > min) { - this.ctx.strokeStyle = this.colors.gauge - - } else { - this.ctx.strokeStyle = this.colors.track - } - this.ctx.beginPath() - this.ctx.moveTo(x, 0) - this.ctx.lineTo(x, this.height) - this.ctx.stroke() - } - } - this.ctx.globalAlpha = 0.3 this.ctx.strokeStyle = this.colors.gauge this.ctx.beginPath() @@ -189,6 +166,24 @@ Fader.prototype.draw = function(){ this.ctx.lineWidth = this.height this.ctx.stroke() + if (!this.widgetData.noPip) { + this.ctx.lineWidth = PXSCALE + this.ctx.globalAlpha = 0.05 + + var x, + min = Math.min(d,o), + max = Math.max(d,o) + + for (var i = 1;i < this.rangeKeys.length - 1;i++) { + x = Math.round(this.percentToCoord(this.rangeKeys[i])) + 0.5 + this.ctx.strokeStyle = this.colors.text + this.ctx.beginPath() + this.ctx.moveTo(x, 0) + this.ctx.lineTo(x, this.height) + this.ctx.stroke() + } + } + this.ctx.globalAlpha = 1 this.ctx.beginPath() this.ctx.fillStyle = this.colors.knob @@ -227,28 +222,6 @@ Fader.prototype.draw = function(){ if (this.widgetData.compact) { - if (!this.widgetData.noPip) { - this.ctx.lineWidth = PXSCALE - this.ctx.globalAlpha = 0.3 - - var y, - min = Math.min(d,o), - max = Math.max(d,o) - - for (var i = 1;i < this.rangeKeys.length - 1;i++) { - y = Math.round(this.percentToCoord(this.rangeKeys[i])) + 0.5 * PXSCALE - if (y < max && y > min) { - this.ctx.strokeStyle = this.colors.gauge - } else { - this.ctx.strokeStyle = this.colors.track - } - this.ctx.beginPath() - this.ctx.moveTo(0, y) - this.ctx.lineTo(this.width, y) - this.ctx.stroke() - } - } - this.ctx.globalAlpha = 0.3 this.ctx.strokeStyle = this.colors.gauge this.ctx.beginPath() @@ -257,6 +230,24 @@ Fader.prototype.draw = function(){ this.ctx.lineWidth = this.width this.ctx.stroke() + if (!this.widgetData.noPip) { + this.ctx.lineWidth = PXSCALE + this.ctx.globalAlpha = 0.05 + + var y, + min = Math.min(d,o), + max = Math.max(d,o) + + for (var i = 1;i < this.rangeKeys.length - 1;i++) { + y = Math.round(this.percentToCoord(this.rangeKeys[i])) + 0.5 + this.ctx.strokeStyle = this.colors.text + this.ctx.beginPath() + this.ctx.moveTo(0, y) + this.ctx.lineTo(this.width, y) + this.ctx.stroke() + } + } + this.ctx.globalAlpha = 1 this.ctx.beginPath() this.ctx.fillStyle = this.colors.knob