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:
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/interface/interface_handlers.c2
-rw-r--r--source/blender/editors/space_node/node_select.c9
2 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index f08829c6556..85e5ea1aee4 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -1762,7 +1762,7 @@ static bool ui_but_drag_init(bContext *C,
/* Clamp the maximum to half the UI unit size so a high user preference
* doesn't require the user to drag more then half the default button height. */
const int drag_threshold = min_ii(
- WM_EVENT_CURSOR_CLICK_DRAG_THRESHOLD,
+ WM_event_drag_threshold(event),
(int)((UI_UNIT_Y / 2) * ui_block_to_window_scale(data->region, but->block)));
if (ABS(data->dragstartx - event->x) + ABS(data->dragstarty - event->y) > drag_threshold) {
diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c
index 11462358d88..78f36719880 100644
--- a/source/blender/editors/space_node/node_select.c
+++ b/source/blender/editors/space_node/node_select.c
@@ -611,13 +611,14 @@ static int node_select_modal(bContext *C, wmOperator *op, const wmEvent *event)
return ret_value | OPERATOR_PASS_THROUGH;
}
else if (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) {
- const int dx = mval[0] - event->mval[0];
- const int dy = mval[1] - event->mval[1];
- const int drag_threshold = WM_EVENT_CURSOR_CLICK_DRAG_THRESHOLD;
+ const int drag_delta[2] = {
+ mval[0] - event->mval[0],
+ mval[1] - event->mval[1],
+ };
/* If user moves mouse more than defined threshold, we consider select operator as
* finished. Otherwise, it is still running until we get an 'release' event. In any
* case, we pass through event, but select op is not finished yet. */
- if (abs(dx) >= drag_threshold || abs(dy) >= drag_threshold) {
+ if (WM_event_drag_test_with_delta(event, drag_delta)) {
return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH;
}
else {