提交 27f20445 编写于 作者: P pissang

fix(label): fix wrong squeeze logic in label layout

上级 f3ed3fab
......@@ -202,16 +202,20 @@ function shiftLayout(
delta = totalGaps * (delta < 0 ? -1 : 1);
}
for (let i = 0; i < len - 1; i++) {
// Distribute the shift delta to all gaps.
const movement = gaps[i] / totalGaps * delta;
if (delta > 0) {
if (delta > 0) {
for (let i = 0; i < len - 1; i++) {
// Distribute the shift delta to all gaps.
const movement = gaps[i] / totalGaps * delta;
// Forward
shiftList(movement, 0, i + 1);
}
else {
// Backward
shiftList(movement, len - i - 1, len);
}
else {
// Backward
for (let i = len - 1; i > 0; i--) {
// Distribute the shift delta to all gaps.
const movement = gaps[i - 1] / totalGaps * delta;
shiftList(movement, i, len);
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册