[Bf-blender-cvs] [afeaac8b18b] master: Fix cursor position on HighDPI in stereo side-by-side mode

Yevgeny Makarov noreply at git.blender.org
Sun Dec 13 21:49:41 CET 2020


Commit: afeaac8b18b2f0d5db0aadae6009cf1d16218c65
Author: Yevgeny Makarov
Date:   Sun Dec 13 12:48:50 2020 -0800
Branches: master
https://developer.blender.org/rBafeaac8b18b2f0d5db0aadae6009cf1d16218c65

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

===================================================================

M	source/blender/windowmanager/intern/wm_stereo.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_stereo.c b/source/blender/windowmanager/intern/wm_stereo.c
index fb9c71163c8..a620accab72 100644
--- a/source/blender/windowmanager/intern/wm_stereo.c
+++ b/source/blender/windowmanager/intern/wm_stereo.c
@@ -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;



More information about the Bf-blender-cvs mailing list