Skip to content

Commit a063780

Browse files
committed
fix: refine resized span calculation
1 parent 333765e commit a063780

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/tile-manager/resize-util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ export class ResizeUtil {
9595
const sizesAfterStart = entries.slice(tilePosition.start - 1);
9696
const availableSize =
9797
sizesAfterStart.reduce((sum, s) => sum + s, 0) +
98-
(entries.length - 1) * gap;
98+
(sizesAfterStart.length - 1) * gap;
9999

100100
if (targetSize <= entries[0] + gap) {
101101
return 1;
102102
}
103103

104-
if (targetSize > availableSize) {
104+
if (Math.trunc(targetSize) > Math.trunc(availableSize)) {
105105
const remainingSize = targetSize - availableSize;
106106

107107
const additionalSpan = Math.ceil(remainingSize / (minSize + gap));

0 commit comments

Comments
 (0)