Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-05-28 17:48:48 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-05-28 17:52:43 +0300
commite4ac8ab212769b569334d0cd15d4bf04f42cbc89 (patch)
tree62cc58acd12f6f1bf974ff810900fa231d918354 /source/blender/windowmanager/intern/wm_operator_type.c
parenta7ebb4b7d96b129d3ac1950ee415754b282bfbc4 (diff)
WM: support X/Y axis cursor wrapping
Operator flags to wrap on a single axis. D4865 by @Gvgeo with updates. Resolves T64585
Diffstat (limited to 'source/blender/windowmanager/intern/wm_operator_type.c')
-rw-r--r--source/blender/windowmanager/intern/wm_operator_type.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/windowmanager/intern/wm_operator_type.c b/source/blender/windowmanager/intern/wm_operator_type.c
index 179b4402200..7ae28f3f448 100644
--- a/source/blender/windowmanager/intern/wm_operator_type.c
+++ b/source/blender/windowmanager/intern/wm_operator_type.c
@@ -430,9 +430,18 @@ static int wm_macro_modal(bContext *C, wmOperator *op, const wmEvent *event)
* */
if (op->opm->type->flag & OPTYPE_BLOCKING) {
int bounds[4] = {-1, -1, -1, -1};
- const bool wrap = ((U.uiflag & USER_CONTINUOUS_MOUSE) &&
- ((op->opm->flag & OP_IS_MODAL_GRAB_CURSOR) ||
- (op->opm->type->flag & OPTYPE_GRAB_CURSOR)));
+ int wrap = CURSOR_WRAP_NONE;
+
+ if ((op->opm->flag & OP_IS_MODAL_GRAB_CURSOR) ||
+ (op->opm->type->flag & OPTYPE_GRAB_CURSOR_XY)) {
+ wrap = CURSOR_WRAP_XY;
+ }
+ else if (op->opm->type->flag & OPTYPE_GRAB_CURSOR_X) {
+ wrap = CURSOR_WRAP_X;
+ }
+ else if (op->opm->type->flag & OPTYPE_GRAB_CURSOR_Y) {
+ wrap = CURSOR_WRAP_Y;
+ }
if (wrap) {
ARegion *ar = CTX_wm_region(C);