From 94016fa70b3200096c6f843621c349ffced7a724 Mon Sep 17 00:00:00 2001 From: Son Pham-Ba Date: Tue, 21 Jan 2025 14:39:48 +0100 Subject: [PATCH] fix: possible nan corners --- lua/smear_cursor/animation.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/smear_cursor/animation.lua b/lua/smear_cursor/animation.lua index 79d3b23..f8f5422 100644 --- a/lua/smear_cursor/animation.lua +++ b/lua/smear_cursor/animation.lua @@ -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)