widgets: add encoder
This commit is contained in:
parent
2e7444ae32
commit
b978d4b9fe
3 changed files with 31 additions and 3 deletions
|
|
@ -2,6 +2,7 @@ var widgets = {
|
|||
// sliders
|
||||
fader: require('./widgets/sliders/fader'),
|
||||
knob: require('./widgets/sliders/knob'),
|
||||
encoder: require('./widgets/sliders/encoder'),
|
||||
|
||||
// buttons
|
||||
toggle: require('./widgets/buttons/toggle'),
|
||||
|
|
@ -42,7 +43,7 @@ var widgets = {
|
|||
}
|
||||
|
||||
module.exports.categories = {
|
||||
'Sliders':['fader','knob'],
|
||||
'Sliders':['fader','knob', 'encoder'],
|
||||
'Buttons':['toggle','push','switch'],
|
||||
'Pads':['xy','rgb','multixy'],
|
||||
'Matrices':['multifader','multitoggle','multipush', 'keyboard'],
|
||||
|
|
|
|||
|
|
@ -142,8 +142,9 @@ module.exports = class Knob extends _sliders_base {
|
|||
|
||||
this.minDimension = Math.min(this.width, this.height)
|
||||
this.gaugeWidth = this.minDimension / 8
|
||||
|
||||
if (this.widgetData.compact) {
|
||||
this.canvas[0].style.top = this.input[0].style.marginTop = (this.minDimension) * this.lostHeightFactor - this.gaugeWidth / 4 + 'px'
|
||||
this.canvas[0].style.top = this.input[0].style.marginTop = (this.minDimension) * this.lostHeightFactor - (this.widgetData.label === false ? 0 : this.gaugeWidth / 4) + 'px'
|
||||
} else {
|
||||
this.canvas[0].style.top = Math.min((this.minDimension) * this.lostHeightFactor - this.margin * PXSCALE / 2, this.input.outerHeight() * .5) + 'px'
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue