shapes: fix nearest size finding for png cursors

fixes #14
This commit is contained in:
Vaxry 2024-05-15 17:50:12 +01:00
parent dfba774650
commit 7c3aa03dff

View file

@ -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;