Implemented stacked button groups.
This commit is contained in:
+20
-46
@@ -263,12 +263,20 @@
|
||||
|
||||
<span class="subtitle">Methods</span>
|
||||
|
||||
<li class="parent " data-name="ButtonGroup#_stackHorizontal"><a href="ButtonGroup.html#_stackHorizontal">_stackHorizontal</a></li>
|
||||
|
||||
<li class="parent " data-name="ButtonGroup#_stackVertical"><a href="ButtonGroup.html#_stackVertical">_stackVertical</a></li>
|
||||
|
||||
<li class="parent " data-name="ButtonGroup#capture"><a href="ButtonGroup.html#capture">capture</a></li>
|
||||
|
||||
<li class="parent " data-name="ButtonGroup#hide"><a href="ButtonGroup.html#hide">hide</a></li>
|
||||
|
||||
<li class="parent " data-name="ButtonGroup#layout"><a href="ButtonGroup.html#layout">layout</a></li>
|
||||
|
||||
<li class="parent " data-name="ButtonGroup#show"><a href="ButtonGroup.html#show">show</a></li>
|
||||
|
||||
<li class="parent " data-name="ButtonGroup#stack"><a href="ButtonGroup.html#stack">stack</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="events itemMembers">
|
||||
|
||||
@@ -1616,12 +1624,8 @@ export default class Slider extends PIXI.Container {
|
||||
|
||||
this.on('pointermove', e => {
|
||||
if (this.control.dragging) {
|
||||
const moveX = this.control.event.data.getLocalPosition(
|
||||
this.control.parent
|
||||
).x
|
||||
this._value = this.pixelToValue(
|
||||
moveX - this.control.delta - this.opts.controlRadius
|
||||
)
|
||||
const moveX = this.control.event.data.getLocalPosition(this.control.parent).x
|
||||
this._value = this.pixelToValue(moveX - this.control.delta - this.opts.controlRadius)
|
||||
let x = this.valueToPixel(this._value) + this.opts.controlRadius
|
||||
this.control.x = x
|
||||
|
||||
@@ -1633,16 +1637,8 @@ export default class Slider extends PIXI.Container {
|
||||
|
||||
if (container instanceof Element) {
|
||||
container.addEventListener('pointerup', e => this.onEnd(e), false)
|
||||
container.addEventListener(
|
||||
'pointercancel',
|
||||
e => this.onEnd(e),
|
||||
false
|
||||
)
|
||||
container.addEventListener(
|
||||
'pointerleave',
|
||||
e => this.onEnd(e),
|
||||
false
|
||||
)
|
||||
container.addEventListener('pointercancel', e => this.onEnd(e), false)
|
||||
container.addEventListener('pointerleave', e => this.onEnd(e), false)
|
||||
container.addEventListener('pointerout', e => this.onEnd(e), false)
|
||||
container.addEventListener('mouseup', e => this.onEnd(e), false)
|
||||
container.addEventListener('mousecancel', e => this.onEnd(e), false)
|
||||
@@ -1703,9 +1699,7 @@ export default class Slider extends PIXI.Container {
|
||||
if (this.sliderObj.pointerdowned) {
|
||||
this.sliderObj.pointerdowned = false
|
||||
const position = e.data.getLocalPosition(this.control.parent)
|
||||
this.value = this.pixelToValue(
|
||||
position.x - this.opts.controlRadius
|
||||
)
|
||||
this.value = this.pixelToValue(position.x - this.opts.controlRadius)
|
||||
TweenLite.to(this.control, this.theme.fast, { alpha: 0.83 })
|
||||
}
|
||||
})
|
||||
@@ -1765,11 +1759,7 @@ export default class Slider extends PIXI.Container {
|
||||
this.sliderObj.clear()
|
||||
this.sliderObj.beginFill(0xffffff, 0)
|
||||
this.sliderObj.drawRect(0, 0, x + w + cr, cr * 2)
|
||||
this.sliderObj.lineStyle(
|
||||
this.opts.strokeWidth,
|
||||
this.opts.stroke,
|
||||
this.opts.strokeAlpha
|
||||
)
|
||||
this.sliderObj.lineStyle(this.opts.strokeWidth, this.opts.stroke, this.opts.strokeAlpha)
|
||||
this.sliderObj.beginFill(this.opts.fill, this.opts.fillAlpha)
|
||||
this.sliderObj.moveTo(x, y)
|
||||
this.sliderObj.lineTo(x + w, y)
|
||||
@@ -1783,20 +1773,10 @@ export default class Slider extends PIXI.Container {
|
||||
|
||||
// Draw control
|
||||
this.control.clear()
|
||||
this.control.lineStyle(
|
||||
this.opts.controlStrokeWidth,
|
||||
this.opts.controlStroke,
|
||||
this.opts.controlStrokeAlpha
|
||||
)
|
||||
this.control.beginFill(
|
||||
this.opts.controlFill,
|
||||
this.opts.controlFillAlpha
|
||||
)
|
||||
this.control.lineStyle(this.opts.controlStrokeWidth, this.opts.controlStroke, this.opts.controlStrokeAlpha)
|
||||
this.control.beginFill(this.opts.controlFill, this.opts.controlFillAlpha)
|
||||
this.control.drawCircle(0, 0, cr - 1)
|
||||
this.control.beginFill(
|
||||
this.opts.controlStroke,
|
||||
this.opts.controlStrokeAlpha
|
||||
)
|
||||
this.control.beginFill(this.opts.controlStroke, this.opts.controlStrokeAlpha)
|
||||
this.control.drawCircle(0, 0, cr / 6)
|
||||
this.control.endFill()
|
||||
|
||||
@@ -1834,10 +1814,7 @@ export default class Slider extends PIXI.Container {
|
||||
} else if (value > this.opts.max) {
|
||||
value = this.opts.max
|
||||
}
|
||||
return (
|
||||
(this.opts.width * (value - this.opts.min)) /
|
||||
(this.opts.max - this.opts.min)
|
||||
)
|
||||
return (this.opts.width * (value - this.opts.min)) / (this.opts.max - this.opts.min)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1853,10 +1830,7 @@ export default class Slider extends PIXI.Container {
|
||||
} else if (pixel > this.opts.width) {
|
||||
pixel = this.opts.width
|
||||
}
|
||||
return (
|
||||
this.opts.min +
|
||||
((this.opts.max - this.opts.min) * pixel) / this.opts.width
|
||||
)
|
||||
return this.opts.min + ((this.opts.max - this.opts.min) * pixel) / this.opts.width
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1951,7 +1925,7 @@ export default class Slider extends PIXI.Container {
|
||||
|
||||
<footer class="content-size">
|
||||
<div class="footer">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Tue Jul 30 2019 10:48:36 GMT+0200 (Mitteleuropäische Sommerzeit)
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Jul 31 2019 15:00:47 GMT+0200 (Mitteleuropäische Sommerzeit)
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user