From 808ead65bff45d874880a1dde6a69cc79a2f2a7d Mon Sep 17 00:00:00 2001 From: moex3 <46636583+moex3@users.noreply.github.com> Date: Wed, 25 Nov 2020 19:36:05 +0100 Subject: [PATCH] Fix crosshair drawing I'm not sure about that scale_factor, i don't know how to test that --- src/video_display.cpp | 2 +- src/visual_tool_cross.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/video_display.cpp b/src/video_display.cpp index 7f9a8d512..b64964a8a 100644 --- a/src/video_display.cpp +++ b/src/video_display.cpp @@ -307,7 +307,7 @@ void VideoDisplay::PositionVideo() { viewport_bottom_end = std::min(viewport_bottom_end, 0); if (tool) { - tool->SetClientSize(viewport_width, viewport_height); + tool->SetClientSize(client_w * scale_factor, client_h * scale_factor); tool->SetDisplayArea(viewport_left / scale_factor, viewport_top / scale_factor, viewport_width / scale_factor, viewport_height / scale_factor); } diff --git a/src/visual_tool_cross.cpp b/src/visual_tool_cross.cpp index 87783c616..ae82be775 100644 --- a/src/visual_tool_cross.cpp +++ b/src/visual_tool_cross.cpp @@ -87,12 +87,12 @@ void VisualToolCross::Draw() { // Place the text in the corner of the cross closest to the center of the video int dx = mouse_pos.X(); int dy = mouse_pos.Y(); - if (dx > video_res.X() / 2) + if (dx > client_size.X() / 2) dx -= tw + 4; else dx += 4; - if (dy < video_res.Y() / 2) + if (dy < client_size.Y() / 2) dy += 3; else dy -= th + 3;