Fix cursor position on HighDPI in stereo side-by-side mode

Could not select left quarter of the screen in stereo side-by-side mode on high dpi displays.

Differential Revision: https://developer.blender.org/D9836

Reviewed by Julian Eisel
This commit is contained in:
Yevgeny Makarov 2020-12-13 12:48:50 -08:00 committed by Harley Acheson
parent 2e5d9a73f7
commit afeaac8b18
1 changed files with 2 additions and 2 deletions

View File

@ -188,7 +188,7 @@ void wm_stereo3d_mouse_offset_apply(wmWindow *win, int *r_mouse_xy)
}
if (win->stereo3d_format->display_mode == S3D_DISPLAY_SIDEBYSIDE) {
const int half_x = win->sizex / 2;
const int half_x = WM_window_pixels_x(win) / 2;
/* right half of the screen */
if (r_mouse_xy[0] > half_x) {
r_mouse_xy[0] -= half_x;
@ -196,7 +196,7 @@ void wm_stereo3d_mouse_offset_apply(wmWindow *win, int *r_mouse_xy)
r_mouse_xy[0] *= 2;
}
else if (win->stereo3d_format->display_mode == S3D_DISPLAY_TOPBOTTOM) {
const int half_y = win->sizey / 2;
const int half_y = WM_window_pixels_y(win) / 2;
/* upper half of the screen */
if (r_mouse_xy[1] > half_y) {
r_mouse_xy[1] -= half_y;