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
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index 4abeb937758..2fb89a49016 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -118,6 +118,8 @@ typedef struct PaintStroke {
float last_pressure;
int stroke_mode;
+ float last_tablet_event_pressure;
+
float zoom_2d;
int pen_flip;
@@ -1355,6 +1357,15 @@ int paint_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event)
1.0f :
WM_event_tablet_data(event, &stroke->pen_flip, NULL));
+ /* When processing a timer event the pressure from the event is 0, so use the last valid
+ * pressure. */
+ if (event->type == TIMER) {
+ pressure = stroke->last_tablet_event_pressure;
+ }
+ else {
+ stroke->last_tablet_event_pressure = pressure;
+ }
+
paint_stroke_add_sample(p, stroke, event->mval[0], event->mval[1], pressure);
paint_stroke_sample_average(stroke, &sample_average);