[Bf-blender-cvs] [4cac8025f00] blender-v3.4-release: Cleanup: use int32_t type, update comments
Campbell Barton
noreply at git.blender.org
Sun Nov 20 00:41:05 CET 2022
Commit: 4cac8025f00798938813f52dcb117be83db97f22
Author: Campbell Barton
Date: Sun Nov 20 10:39:43 2022 +1100
Branches: blender-v3.4-release
https://developer.blender.org/rB4cac8025f00798938813f52dcb117be83db97f22
Cleanup: use int32_t type, update comments
Reference WIP patches for warping on the spot, follow up to T102346.
===================================================================
M intern/ghost/intern/GHOST_SystemWin32.cpp
M intern/ghost/intern/GHOST_SystemX11.cpp
===================================================================
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index 829177793ef..4d016373fc6 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -1069,10 +1069,10 @@ GHOST_EventCursor *GHOST_SystemWin32::processCursorEvent(GHOST_WindowWin32 *wind
* so the box needs to small enough not to let the cursor escape the window but large
* enough that the cursor isn't being warped every time.
* If this was not the case it would be less trouble to simply warp the cursor to the
- * center of the screen on every motion, see: T102346. */
+ * center of the screen on every motion, see: D16558 (alternative fix for T102346). */
const int32_t subregion_div = 4; /* One quarter of the region. */
const int32_t size[2] = {bounds.getWidth(), bounds.getHeight()};
- const int center[2] = {(bounds.m_l + bounds.m_r) / 2, (bounds.m_t + bounds.m_b) / 2};
+ const int32_t center[2] = {(bounds.m_l + bounds.m_r) / 2, (bounds.m_t + bounds.m_b) / 2};
/* Shrink the box to prevent the cursor escaping. */
bounds.m_l = center[0] - (size[0] / (subregion_div * 2));
bounds.m_r = center[0] + (size[0] / (subregion_div * 2));
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index 9e424015d0c..1462433277f 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -945,10 +945,13 @@ void GHOST_SystemX11::processEvent(XEvent *xe)
window->getClientBounds(bounds);
/* TODO(@campbellbarton): warp the cursor to `window->getCursorGrabInitPos`,
- * on every motion event, see: T102346. */
+ * on every motion event, see: D16557 (alternative fix for T102346). */
const int32_t subregion_div = 4; /* One quarter of the region. */
const int32_t size[2] = {bounds.getWidth(), bounds.getHeight()};
- const int center[2] = {(bounds.m_l + bounds.m_r) / 2, (bounds.m_t + bounds.m_b) / 2};
+ const int32_t center[2] = {
+ (bounds.m_l + bounds.m_r) / 2,
+ (bounds.m_t + bounds.m_b) / 2,
+ };
/* Shrink the box to prevent the cursor escaping. */
bounds.m_l = center[0] - (size[0] / (subregion_div * 2));
bounds.m_r = center[0] + (size[0] / (subregion_div * 2));
More information about the Bf-blender-cvs
mailing list