diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2013-03-16 02:32:44 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2013-03-16 02:32:44 +0400 |
commit | 6379dea41c60521264ee5faf882fbcbc81ce0c45 (patch) | |
tree | 4d64b79f0a0d1c87a727d7b0be359b891d27807e | |
parent | 6347f96f535f9d3066b4b2f6e2110a6cfdb71300 (diff) |
minor cleanup and calculate rake angle before jittering or result
becomes essentially, random
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_stroke.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index f37b58b9cd9..66df3a8be33 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -143,11 +143,11 @@ static float event_tablet_data(const wmEvent *event, int *pen_flip) return pressure; } -#if 1 + /* Initialize the stroke cache variants from operator properties */ static void paint_brush_update(bContext *C, Brush *brush, PaintMode mode, struct PaintStroke *stroke, - float mouse[2], float pressure) + const float mouse[2], float pressure) { Scene *scene = CTX_data_scene(C); UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings; @@ -234,7 +234,7 @@ static void paint_brush_update(bContext *C, Brush *brush, PaintMode mode, stroke->brush_init = TRUE; } -#endif + /* Put the location of the next stroke dot into the stroke RNA and apply it to the mesh */ static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, const wmEvent *event, const float mouse_in[2]) @@ -273,6 +273,8 @@ static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, const wmEve * will create too many dabs */ copy_v2_v2(stroke->last_mouse_position, mouse_in); + paint_brush_update(C, brush, mode, stroke, mouse_in, pressure); + /* TODO: as sculpt and other paint modes are unified, this * separation will go away */ if (paint_supports_jitter(mode)) { @@ -303,8 +305,6 @@ static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, const wmEve else zero_v3(location); - paint_brush_update(C, brush, mode, stroke, mouse_out, pressure); - /* Add to stroke */ RNA_collection_add(op->ptr, "stroke", &itemptr); |