1
0
Fork 0

Fix crosshair drawing

I'm not sure about that scale_factor, i don't know how to test that
This commit is contained in:
moex3 2020-11-25 19:36:05 +01:00 committed by Sodra
parent 0ec0f20695
commit 808ead65bf
2 changed files with 3 additions and 3 deletions

View File

@ -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);
}

View File

@ -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;