1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Implement user-defined cursor scaling

This commit is contained in:
Ivan Savenko
2024-10-07 19:34:28 +00:00
parent 7d58f89992
commit 68e5cff276
2 changed files with 8 additions and 1 deletions

View File

@@ -48,7 +48,9 @@ void CursorHardware::setVisible(bool on)
void CursorHardware::setImage(std::shared_ptr<IImage> image, const Point & pivotOffset)
{
int cursorScalingPercent = settings["video"]["resolution"]["scaling"].Integer();
int videoScalingSettings = settings["video"]["resolution"]["scaling"].Integer();
float cursorScalingSettings = settings["video"]["cursorScalingFactor"].Float();
int cursorScalingPercent = videoScalingSettings * cursorScalingSettings;
Point cursorDimensions = image->dimensions() * GH.screenHandler().getScalingFactor();
Point cursorDimensionsScaled = image->dimensions() * cursorScalingPercent / 100;
Point pivotOffsetScaled = pivotOffset * cursorScalingPercent / 100 / GH.screenHandler().getScalingFactor();