From 7c3aa03dffb53921e583ade3d4ae3f487e390e7e Mon Sep 17 00:00:00 2001 From: Vaxry Date: Wed, 15 May 2024 17:50:12 +0100 Subject: [PATCH] shapes: fix nearest size finding for png cursors fixes #14 --- libhyprcursor/hyprcursor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libhyprcursor/hyprcursor.cpp b/libhyprcursor/hyprcursor.cpp index f6bd20a..8ffa7bb 100644 --- a/libhyprcursor/hyprcursor.cpp +++ b/libhyprcursor/hyprcursor.cpp @@ -306,7 +306,7 @@ SCursorImageData** CHyprcursorManager::getShapesC(int& outSize, const char* shap // find nearest int leader = 13371337; for (auto& image : impl->loadedShapes[shape.get()].images) { - if (std::abs((int)(image->side - info.size)) > leader) + if (std::abs((int)(image->side - info.size)) > std::abs((int)(leader - info.size))) continue; leader = image->side;