diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-06-27 14:56:57 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-06-27 14:57:16 +0400 |
commit | b97d3bc198244d88d71b5e514af6b4c039eec584 (patch) | |
tree | e1fb591f269acb8f0a8893ea5594917849c23741 | |
parent | d6ab81809e25eb827f450006efa1442a52bcec11 (diff) |
Fix T40834, grab brush not working after recent jittering fix.
Some brushes do not require location always. Made a list here, there may
be others but I think this pretty much covers this.
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_stroke.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 93408586704..452e2885d7a 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -155,6 +155,23 @@ static float event_tablet_data(const wmEvent *event, int *pen_flip) return pressure; } +static bool paint_tool_require_location(Brush *brush, PaintMode mode) { + switch (mode) { + case PAINT_SCULPT: + if (ELEM4(brush->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_ROTATE, + SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB)) + { + return false; + } + else + return true; + + default: + break; + } + + return true; +} /* Initialize the stroke cache variants from operator properties */ static void paint_brush_update(bContext *C, Brush *brush, PaintMode mode, @@ -257,6 +274,9 @@ static void paint_brush_update(bContext *C, Brush *brush, PaintMode mode, if (stroke->get_location(C, out, halfway)) { hit = true; } + else if (!paint_tool_require_location(brush, mode)) { + hit = true; + } } else { hit = true; @@ -338,9 +358,11 @@ static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, const float /* TODO: can remove the if statement once all modes have this */ if (stroke->get_location) { if (!stroke->get_location(C, location, mouse_out)) { - if (ar && (paint->flags & PAINT_SHOW_BRUSH)) - WM_paint_cursor_tag_redraw(window, ar); - return; + if (paint_tool_require_location(brush, mode)) { + if (ar && (paint->flags & PAINT_SHOW_BRUSH)) + WM_paint_cursor_tag_redraw(window, ar); + return; + } } } else |