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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-11-04 23:15:17 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-11-04 23:15:17 +0300
commit8b8f8fc11e8369b740ca00e27db771077b0ffbb5 (patch)
tree169cce71ae467f6420d918dfaeb54362476d5359 /source/blender/editors/sculpt_paint
parent4f10b3db6a630b53be039520d9348945f146fa93 (diff)
Sculpt: fix bug where mouse release event was not caught in some cases.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c28
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;
}