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>2010-06-23 22:47:56 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2010-06-23 22:47:56 +0400
commitf507428d1189b48ba66a4a7826cd5db178b383a1 (patch)
tree1e84574805835bec71b6d3e197e2100c36c037d5 /source/blender/editors/sculpt_paint
parent5b9059e2bd5be30500f7207ff4728f8cb1f4b2ff (diff)
Fix #22553: dragging number buttons would run update functions more often than
necessary due to the more accurate mouse move events that are useful for sculpting and painting (at least on Linux/X11, not sure about other platforms). If the update function takes a while to run, this in turn causes more mouse move events to be accumulated, making things even slower, .. going into a spiral of slower and slower redraws. As a solution I've added a INBETWEEN_MOUSEMOVE event next to MOUSEMOVE. A MOUSEMOVE event is automatically changed to INBETWEEN_MOUSEMOVE when a MOUSEMOVE event is added after it. This new event type is only handled by painting/sculpting operators, everything else can happily ignore it.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c1
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 64f00caf479..6269b9c5e09 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -4872,6 +4872,7 @@ static int paint_modal(bContext *C, wmOperator *op, wmEvent *event)
paint_exit(C, op);
return OPERATOR_FINISHED;
case MOUSEMOVE:
+ case INBETWEEN_MOUSEMOVE:
paint_apply_event(C, op, event);
break;
case TIMER:
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index 03454a305ba..441464c5743 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -275,7 +275,7 @@ int paint_stroke_modal(bContext *C, wmOperator *op, wmEvent *event)
MEM_freeN(stroke);
return OPERATOR_FINISHED;
}
- else if(first || event->type == MOUSEMOVE || (event->type == TIMER && (event->customdata == stroke->timer))) {
+ else if(first || ELEM(event->type, MOUSEMOVE, INBETWEEN_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)) {