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:
authorPablo Dobarro <pablodp606@gmail.com>2019-10-01 21:00:48 +0300
committerPablo Dobarro <pablodp606@gmail.com>2019-10-02 17:00:10 +0300
commit606af693fb5119e68f8bcd6528f501d5c491f658 (patch)
treed4b1e7d74fd29ed824b192ab55a96ed3b1214fca /source/blender/windowmanager/intern/wm_operators.c
parent29f25da76924a59e82e5c01d9c54ff75943a1f1a (diff)
Fix T70310: Difficult to change brush size from big to small
Changing this values should only support horizontal movement as we are no longer trying to match the size of the cursor and the size of the circle preview in the widget. Reviewed By: brecht Maniphest Tasks: T70310 Differential Revision: https://developer.blender.org/D5931
Diffstat (limited to 'source/blender/windowmanager/intern/wm_operators.c')
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 285379e90c6..69c535308e6 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -2621,38 +2621,34 @@ static int radial_control_modal(bContext *C, wmOperator *op, const wmEvent *even
}
else {
delta[0] = rc->initial_mouse[0] - rc->slow_mouse[0];
- delta[1] = rc->initial_mouse[1] - rc->slow_mouse[1];
+ delta[1] = 0.0f;
if (rc->zoom_prop) {
RNA_property_float_get_array(&rc->zoom_ptr, rc->zoom_prop, zoom);
delta[0] /= zoom[0];
- delta[1] /= zoom[1];
}
dist = len_v2(delta);
delta[0] = event->x - rc->slow_mouse[0];
- delta[1] = event->y - rc->slow_mouse[1];
if (rc->zoom_prop) {
delta[0] /= zoom[0];
- delta[1] /= zoom[1];
}
- dist = dist + 0.1f * (delta[0] + delta[1]);
+ dist = dist + 0.1f * (delta[0]);
}
}
else {
delta[0] = rc->initial_mouse[0] - event->x;
- delta[1] = rc->initial_mouse[1] - event->y;
+ delta[1] = 0.0f;
if (rc->zoom_prop) {
RNA_property_float_get_array(&rc->zoom_ptr, rc->zoom_prop, zoom);
delta[0] /= zoom[0];
- delta[1] /= zoom[1];
}
- dist = len_v2(delta);
+ dist = clamp_f(-delta[0], 0.0f, FLT_MAX);
}
/* calculate new value and apply snapping */