Fixed bug with stacked buttons in a button group with badges.
This commit is contained in:
@@ -2004,7 +2004,7 @@ export default class ButtonGroup extends PIXI.Container {
|
||||
|
||||
this.buttons.forEach((it, index) => {
|
||||
const leftCorner = it.__originalPosition.x + this.container.x
|
||||
const rightCorner = it.__originalPosition.x + it.width
|
||||
const rightCorner = it.__originalPosition.x + it.button.width
|
||||
const paddingLeft = index * this.opts.stackPadding
|
||||
const paddingRight = reverseCounter * this.opts.stackPadding
|
||||
if (leftCorner < paddingLeft) {
|
||||
@@ -2012,7 +2012,7 @@ export default class ButtonGroup extends PIXI.Container {
|
||||
it.x = -this.container.x + paddingLeft
|
||||
} else if (rightCorner > -this.container.x + this.opts.maxWidth - paddingRight) {
|
||||
// right border
|
||||
it.x = -this.container.x + this.opts.maxWidth - it.width - paddingRight
|
||||
it.x = -this.container.x + this.opts.maxWidth - it.button.width - paddingRight
|
||||
} else {
|
||||
it.x = it.__originalPosition.x
|
||||
}
|
||||
@@ -2023,7 +2023,7 @@ export default class ButtonGroup extends PIXI.Container {
|
||||
})
|
||||
|
||||
const min = Math.min(...sorted.map(it => it.x))
|
||||
const max = Math.max(...sorted.map(it => it.x))
|
||||
const max = Math.max(...sorted.map(it => it.x + it.button.width))
|
||||
const center = (min + max) / 2
|
||||
|
||||
// z-index
|
||||
@@ -2052,7 +2052,7 @@ export default class ButtonGroup extends PIXI.Container {
|
||||
|
||||
this.buttons.forEach((it, index) => {
|
||||
const topCorner = it.__originalPosition.y + this.container.y
|
||||
const bottomCorner = it.__originalPosition.y + it.height
|
||||
const bottomCorner = it.__originalPosition.y + it.button.height
|
||||
const paddingTop = index * this.opts.stackPadding
|
||||
const paddingBottom = reverseCounter * this.opts.stackPadding
|
||||
if (topCorner < paddingTop) {
|
||||
@@ -2060,7 +2060,7 @@ export default class ButtonGroup extends PIXI.Container {
|
||||
it.y = -this.container.y + paddingTop
|
||||
} else if (bottomCorner > -this.container.y + this.opts.maxHeight - paddingBottom) {
|
||||
// bottom border
|
||||
it.y = -this.container.y + this.opts.maxHeight - it.height - paddingBottom
|
||||
it.y = -this.container.y + this.opts.maxHeight - it.button.height - paddingBottom
|
||||
} else {
|
||||
it.y = it.__originalPosition.y
|
||||
}
|
||||
@@ -2071,7 +2071,7 @@ export default class ButtonGroup extends PIXI.Container {
|
||||
})
|
||||
|
||||
const min = Math.min(...sorted.map(it => it.y))
|
||||
const max = Math.max(...sorted.map(it => it.y))
|
||||
const max = Math.max(...sorted.map(it => it.y + it.button.height))
|
||||
const center = (min + max) / 2
|
||||
|
||||
// z-index
|
||||
@@ -2103,7 +2103,7 @@ export default class ButtonGroup 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 Thu Aug 01 2019 10:17:52 GMT+0200 (Mitteleuropäische Sommerzeit)
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Thu Aug 01 2019 10:30:39 GMT+0200 (Mitteleuropäische Sommerzeit)
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user