From 612490712e206a53421fdcf46055ca161899a7cc Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Thu, 12 Sep 2024 21:22:29 +0000 Subject: [PATCH] Fix cursor pivot/tip offset for xbrz mode --- client/gui/CursorHandler.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/gui/CursorHandler.cpp b/client/gui/CursorHandler.cpp index 146f27b9c..eaa8cfd98 100644 --- a/client/gui/CursorHandler.cpp +++ b/client/gui/CursorHandler.cpp @@ -17,6 +17,7 @@ #include "../renderSDL/CursorHardware.h" #include "../render/CAnimation.h" #include "../render/IImage.h" +#include "../render/IScreenHandler.h" #include "../render/IRenderHandler.h" #include "../../lib/CConfigHandler.h" @@ -175,7 +176,7 @@ Point CursorHandler::getPivotOffsetMap(size_t index) assert(offsets.size() == size_t(Cursor::Map::COUNT)); //Invalid number of pivot offsets for cursor assert(index < offsets.size()); - return offsets[index]; + return offsets[index] * GH.screenHandler().getScalingFactor(); } Point CursorHandler::getPivotOffsetCombat(size_t index) @@ -205,12 +206,12 @@ Point CursorHandler::getPivotOffsetCombat(size_t index) assert(offsets.size() == size_t(Cursor::Combat::COUNT)); //Invalid number of pivot offsets for cursor assert(index < offsets.size()); - return offsets[index]; + return offsets[index] * GH.screenHandler().getScalingFactor(); } Point CursorHandler::getPivotOffsetSpellcast() { - return { 18, 28}; + return Point(18, 28) * GH.screenHandler().getScalingFactor(); } Point CursorHandler::getPivotOffset()