Fixed bug with stacked buttons in a button group with badges.

This commit is contained in:
2019-08-01 10:31:05 +02:00
parent e9f1246e0a
commit b1f0f173e7
69 changed files with 85 additions and 85 deletions
+6 -6
View File
@@ -3477,7 +3477,7 @@
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) {
@@ -3485,7 +3485,7 @@
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;
}
@@ -3496,7 +3496,7 @@
});
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
@@ -3525,7 +3525,7 @@
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) {
@@ -3533,7 +3533,7 @@
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;
}
@@ -3544,7 +3544,7 @@
});
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