Skip to content

Commit

Permalink
shapes: fix nearest size finding for png cursors
Browse files Browse the repository at this point in the history
fixes #14
  • Loading branch information
vaxerski committed May 15, 2024
1 parent dfba774 commit 7c3aa03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libhyprcursor/hyprcursor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7c3aa03

Please sign in to comment.