From edea36cc29a9e0f69ae0a8abbc1331f132fdd723 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Thu, 27 Apr 2017 10:16:10 +0200 Subject: [PATCH] knob: zoom pxscaling bug fix --- src/browser/js/app/widgets/sliders/encoder.js | 2 +- src/browser/js/app/widgets/sliders/knob.js | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/browser/js/app/widgets/sliders/encoder.js b/src/browser/js/app/widgets/sliders/encoder.js index 5314ce2c..9463cf0d 100644 --- a/src/browser/js/app/widgets/sliders/encoder.js +++ b/src/browser/js/app/widgets/sliders/encoder.js @@ -28,7 +28,7 @@ var DisplayKnob = class extends Knob { this.ctx.beginPath() this.ctx.fillStyle = this.colors.raised this.ctx.strokeStyle = this.colors.raised - this.ctx.arc(this.width / 2, this.height / 2, this.minDimension / 2 - this.gaugeWidth * 1.5 * PXSCALE - 2 * PXSCALE, 0, Math.PI * 2) + this.ctx.arc(this.width / 2, this.height / 2, this.minDimension / 2 - this.gaugeWidth * 1.5, 0, Math.PI * 2) this.ctx.fill() this.ctx.globalAlpha = 0.3 this.ctx.lineWidth = 1.1 * PXSCALE diff --git a/src/browser/js/app/widgets/sliders/knob.js b/src/browser/js/app/widgets/sliders/knob.js index 66220d23..594cea55 100644 --- a/src/browser/js/app/widgets/sliders/knob.js +++ b/src/browser/js/app/widgets/sliders/knob.js @@ -162,23 +162,23 @@ module.exports = class Knob extends _sliders_base { if (this.widgetData.compact) { - this.ctx.lineWidth = this.gaugeWidth * PXSCALE + this.ctx.lineWidth = this.gaugeWidth this.ctx.globalAlpha = 0.3 this.ctx.beginPath() this.ctx.strokeStyle = this.colors.track - this.ctx.arc(this.width / 2, this.height / 2, this.minDimension / 2 - (this.gaugeWidth + this.margin) * PXSCALE, min, max) + this.ctx.arc(this.width / 2, this.height / 2, this.minDimension / 2 - this.gaugeWidth - this.margin * PXSCALE, min, max) this.ctx.stroke() this.ctx.globalAlpha = 0.2 + 0.2 * Math.abs(d-o) / (d