fader: optimize compact mode draw by reducing width to 1px and let the css stretching do the magic
This commit is contained in:
parent
b20a9716b5
commit
c299c92f09
1 changed files with 13 additions and 2 deletions
|
|
@ -157,6 +157,17 @@ module.exports = class Fader extends _sliders_base {
|
|||
|
||||
}
|
||||
|
||||
resizeHandle(){
|
||||
super.resizeHandle(...arguments)
|
||||
if (this.widgetData.compact) {
|
||||
if (this.widgetData.horizontal) {
|
||||
this.canvas[0].setAttribute('height', 1)
|
||||
} else {
|
||||
this.canvas[0].setAttribute('width', 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
draw() {
|
||||
|
||||
|
|
@ -242,8 +253,8 @@ module.exports = class Fader extends _sliders_base {
|
|||
this.ctx.globalAlpha = 0.75
|
||||
|
||||
var y,
|
||||
min = Math.min(d,o),
|
||||
max = Math.max(d,o)
|
||||
min = Math.min(d,o),
|
||||
max = Math.max(d,o)
|
||||
|
||||
this.ctx.beginPath()
|
||||
for (var i = 1;i < this.rangeKeys.length - 1;i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue