Skip to content

Commit

Permalink
Fix slice step infinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
kettek committed Dec 18, 2024
1 parent 4c28ce4 commit d2d5d8c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions frontend/src/sections/Render.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@
ctx.fillStyle = $renderSettings.backgroundColor
let frames: { data: ArrayBufferLike; delay: number }[] = []
const sliceDistanceEnd = $renderSettings.interpolateSlices ? $renderSettings.sliceDistance * $renderSettings.zoom : 1
const sliceStep = $renderSettings.interpolateSlices ? 1 : $renderSettings.sliceDistance * $renderSettings.zoom
const sliceDistanceEnd = Math.max(1, $renderSettings.interpolateSlices ? $renderSettings.sliceDistance * $renderSettings.zoom : 1)
const sliceStep = Math.max(1, $renderSettings.interpolateSlices ? 1 : $renderSettings.sliceDistance * $renderSettings.zoom)
for (let i = $renderSettings.angleOffset; i < 360 + $renderSettings.angleOffset; i += $renderSettings.angleSteps) {
ctx.fillRect(0, 0, size, size)
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/sections/SmallStackPreview.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
const frameWidth = file.frameWidth * zoom
const frameHeight = file.frameHeight * zoom
const sliceDistanceEnd = $smallPreviewSettings.interpolateSlices ? sliceDistance * zoom : 1
const sliceStep = $smallPreviewSettings.interpolateSlices ? 1 : sliceDistance * zoom
const sliceDistanceEnd = Math.max(1, $smallPreviewSettings.interpolateSlices ? sliceDistance * zoom : 1)
const sliceStep = Math.max(1, $smallPreviewSettings.interpolateSlices ? 1 : sliceDistance * zoom)
if (file.animation) {
const animation = file.animation
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/sections/StackPreview.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@
canvas.height = rect.height
}
const sliceDistanceEnd = $previewSettings.interpolateSlices ? sliceDistance * zoom : 1
const sliceStep = $previewSettings.interpolateSlices ? 1 : sliceDistance * zoom
const sliceDistanceEnd = Math.max(1, $previewSettings.interpolateSlices ? sliceDistance * zoom : 1)
const sliceStep = Math.max(1, $previewSettings.interpolateSlices ? 1 : sliceDistance * zoom)
let ctx = canvas.getContext('2d')
if (!ctx) return
Expand Down

0 comments on commit d2d5d8c

Please sign in to comment.