Skip to content

Commit

Permalink
fix: possible nan corners
Browse files Browse the repository at this point in the history
  • Loading branch information
sphamba committed Jan 21, 2025
1 parent d758c6a commit 94016fa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lua/smear_cursor/animation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ local function shrink_volume(corners)
double_volumes[i] = edges[1][2] * edges[2][1] - edges[1][1] * edges[2][2]
end
local volume = (double_volumes[1] + double_volumes[2]) / 2
if volume <= 0 then return corners end

local center = get_center(corners)
local factor = (1 / volume) ^ (config.volume_reduction_exponent / 2)
Expand Down

0 comments on commit 94016fa

Please sign in to comment.