gitea push
This commit is contained in:
+4
-2
@@ -50,8 +50,10 @@ export function useChunks(props, containerWidth) {
|
||||
}
|
||||
const gapRelativeSize = 100 * chunkGap.value / containerSize;
|
||||
const chunkRelativeSize = 100 * (chunkWidth.value + chunkGap.value) / containerSize;
|
||||
const filledChunks = Math.floor((val + gapRelativeSize) / chunkRelativeSize);
|
||||
return clamp(0, filledChunks * chunkRelativeSize - gapRelativeSize / 2, 100);
|
||||
|
||||
// low-effort workaround to floating-point rounding in the division
|
||||
const filledChunks = Math.floor((val + gapRelativeSize) / chunkRelativeSize + 1e-9);
|
||||
return clamp(filledChunks * chunkRelativeSize - gapRelativeSize / 2, 0, 100);
|
||||
}
|
||||
return {
|
||||
hasChunks,
|
||||
|
||||
Reference in New Issue
Block a user