diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-11-04 23:15:17 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-11-04 23:15:17 +0300 |
commit | 8b8f8fc11e8369b740ca00e27db771077b0ffbb5 (patch) | |
tree | 169cce71ae467f6420d918dfaeb54362476d5359 /source/blender/editors | |
parent | 4f10b3db6a630b53be039520d9348945f146fa93 (diff) |
Sculpt: fix bug where mouse release event was not caught in some cases.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_stroke.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index c47b83b7e70..6d7fd826534 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -257,8 +257,20 @@ int paint_stroke_modal(bContext *C, wmOperator *op, wmEvent *event) //ED_region_tag_redraw(ar); } - /* TODO: fix hardcoded event here */ - if(first || event->type == MOUSEMOVE || (event->type == TIMER && (event->customdata == stroke->timer))) { + /* TODO: fix hardcoded events here */ + if(event->type == LEFTMOUSE && event->val == KM_RELEASE) { + /* exit stroke, free data */ + if(stroke->smooth_stroke_cursor) + WM_paint_cursor_end(CTX_wm_manager(C), stroke->smooth_stroke_cursor); + + if(stroke->timer) + WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), stroke->timer); + + stroke->done(C, stroke); + MEM_freeN(stroke); + return OPERATOR_FINISHED; + } + else if(first || event->type == MOUSEMOVE || (event->type == TIMER && (event->customdata == stroke->timer))) { if(stroke->stroke_started) { if(paint_smooth_stroke(stroke, mouse, event)) { if(paint_space_stroke_enabled(stroke->brush)) { @@ -272,18 +284,6 @@ int paint_stroke_modal(bContext *C, wmOperator *op, wmEvent *event) ;//ED_region_tag_redraw(ar); } } - else if(event->type == LEFTMOUSE && event->val == KM_RELEASE) { - /* exit stroke, free data */ - if(stroke->smooth_stroke_cursor) - WM_paint_cursor_end(CTX_wm_manager(C), stroke->smooth_stroke_cursor); - - if(stroke->timer) - WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), stroke->timer); - - stroke->done(C, stroke); - MEM_freeN(stroke); - return OPERATOR_FINISHED; - } return OPERATOR_RUNNING_MODAL; } |