From 43cc2f7b2a45fe7f5580431e7e9474c2359453b6 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 28 Feb 2018 10:23:00 +0100 Subject: [PATCH] knob: make design more responsive --- CHANGELOG.md | 5 +++++ src/browser/js/app/widgets/sliders/knob.js | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd127264..69976a31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## next + +- widgets + - knob: big knobs design tweaks + ## 0.24.3 - bug fixes diff --git a/src/browser/js/app/widgets/sliders/knob.js b/src/browser/js/app/widgets/sliders/knob.js index 6bb47fd2..70af95b6 100644 --- a/src/browser/js/app/widgets/sliders/knob.js +++ b/src/browser/js/app/widgets/sliders/knob.js @@ -150,7 +150,7 @@ module.exports = class Knob extends Slider { dashed = this.getProp('dashed'), pipsWidth = this.getProp('pips') && !tiny ? 3 * PXSCALE : 0, pipsRadius = this.minDimension / 2 - pipsWidth / 2 - margin, - gaugeWidth = 7 * PXSCALE, + gaugeWidth = Math.max(7 * PXSCALE, this.minDimension / 12), gaugeRadius = pipsRadius - gaugeWidth / 2 - pipsWidth * 1.5, knobRadius = gaugeRadius - gaugeWidth @@ -257,7 +257,7 @@ module.exports = class Knob extends Slider { this.ctx.moveTo(r1 * Math.cos(a) + this.width / 2, this.height / 2 - r1 * Math.sin(a)) this.ctx.lineTo(r2 * Math.cos(a) + this.width / 2, this.height / 2 - r2 * Math.sin(a)) - this.ctx.lineWidth = 2 * PXSCALE + this.ctx.lineWidth = gaugeWidth / 3.5 this.ctx.strokeStyle = this.colors.knob this.ctx.stroke()