From eeffefb4261d10d9de6b2e28a4db8726fe8cfe71 Mon Sep 17 00:00:00 2001 From: Virt <41426325+VirtCode@users.noreply.github.com> Date: Sat, 29 Jun 2024 15:02:49 +0200 Subject: [PATCH] fix: monitor scale issues with hostpot --- src/cursor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cursor.cpp b/src/cursor.cpp index 91f87ad..648af7b 100644 --- a/src/cursor.cpp +++ b/src/cursor.cpp @@ -63,7 +63,7 @@ void CDynamicCursors::renderSoftware(CPointerManager* pointers, SP pMo box.rot = this->angle; // now pass the hotspot to rotate around - renderCursorTextureInternalWithDamage(texture, &box, &damage, 1.F, pointers->currentCursorImage.hotspot * zoom, zoom > 1 && **PNEAREST); + renderCursorTextureInternalWithDamage(texture, &box, &damage, 1.F, pointers->currentCursorImage.hotspot * state->monitor->scale * zoom, zoom > 1 && **PNEAREST); } /* @@ -164,7 +164,7 @@ wlr_buffer* CDynamicCursors::renderHardware(CPointerManager* pointers, SPangle; // use our custom draw function - renderCursorTextureInternalWithDamage(texture, &xbox, &damage, 1.F, pointers->currentCursorImage.hotspot * zoom, zoom > 1 && **PNEAREST); + renderCursorTextureInternalWithDamage(texture, &xbox, &damage, 1.F, pointers->currentCursorImage.hotspot * state->monitor->scale * zoom, zoom > 1 && **PNEAREST); g_pHyprOpenGL->end(); glFlush(); @@ -187,7 +187,7 @@ bool CDynamicCursors::setHardware(CPointerManager* pointers, SPoutput->cursor_swapchain) return false; // we need to transform the hotspot manually as we need to indent it by the size - const auto HOTSPOT = CBox{(pointers->currentCursorImage.hotspot + pointers->currentCursorImage.size) * P_MONITOR->scale * zoom, {0, 0}} + const auto HOTSPOT = CBox{((pointers->currentCursorImage.hotspot * P_MONITOR->scale) + pointers->currentCursorImage.size) * zoom, {0, 0}} .transform(wlTransformToHyprutils(wlr_output_transform_invert(P_MONITOR->transform)), P_MONITOR->output->cursor_swapchain->width, P_MONITOR->output->cursor_swapchain->height) .pos();