diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2013-12-10 00:36:33 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2013-12-10 00:40:02 +0400 |
commit | f0675b14d84392e65c9e746752defa707335626c (patch) | |
tree | 063c281b5b063d506d9a46bb1970e69f33975470 /source/blender/editors/sculpt_paint/paint_cursor.c | |
parent | ec30d711ccfc28be494580df38d4fce9c0a00875 (diff) |
Refactoring/cleanup, borrowed from soc-2013-paint branch.
* Move symmetry options to the paint struct (where all paint systems can
make use of it)
* Rename draw_pressure to stroke_active. This is what is really checked
on those occasions that this is used. Also move turning on/off of this
option to the stroke level and avoid doing it on every stroke system.
* Rename BRUSH_RESTORE_MESH to BRUSH_DRAG_DOT. In image painting this
won't restore any mesh, so better have a name that is directly linked to
what the flag actually does.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_cursor.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_cursor.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index 56143d00afe..2dc6babdfa6 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -569,7 +569,7 @@ static void paint_draw_tex_overlay(UnifiedPaintSettings *ups, Brush *brush, glTranslatef(-0.5f, -0.5f, 0); /* scale based on tablet pressure */ - if (primary && ups->draw_pressure && BKE_brush_use_size_pressure(vc->scene, brush)) { + if (primary && ups->stroke_active && BKE_brush_use_size_pressure(vc->scene, brush)) { glTranslatef(0.5f, 0.5f, 0); glScalef(1.0f / ups->pressure_value, 1.0f / ups->pressure_value, 1); glTranslatef(-0.5f, -0.5f, 0); @@ -694,7 +694,7 @@ static void paint_draw_cursor_overlay(UnifiedPaintSettings *ups, Brush *brush, } /* scale based on tablet pressure */ - if (ups->draw_pressure && BKE_brush_use_size_pressure(vc->scene, brush)) { + if (ups->stroke_active && BKE_brush_use_size_pressure(vc->scene, brush)) { do_pop = true; glPushMatrix(); glLoadIdentity(); @@ -788,7 +788,7 @@ static void paint_cursor_on_hit(UnifiedPaintSettings *ups, Brush *brush, ViewCon projected_radius); /* scale 3D brush radius by pressure */ - if (ups->draw_pressure && BKE_brush_use_size_pressure(vc->scene, brush)) + if (ups->stroke_active && BKE_brush_use_size_pressure(vc->scene, brush)) unprojected_radius *= ups->pressure_value; /* set cached value in either Brush or UnifiedPaintSettings */ @@ -828,11 +828,13 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused)) outline_col = brush->add_col; final_radius = BKE_brush_size_get(scene, brush) * zoomx; - if (brush->flag & BRUSH_RAKE) - /* here, translation contains the mouse coordinates. */ - paint_calculate_rake_rotation(ups, translation); - else if (!(brush->flag & BRUSH_ANCHORED)) - ups->brush_rotation = 0.0; + /* don't calculate rake angles while a stroke is active because the rake variables are global and + * we may get interference with the stroke itself. For line strokes, such interference is visible */ + if (!ups->stroke_active) { + if (brush->flag & BRUSH_RAKE) + /* here, translation contains the mouse coordinates. */ + paint_calculate_rake_rotation(ups, translation); + } /* draw overlay */ paint_draw_alpha_overlay(ups, brush, &vc, x, y, zoomx, mode); @@ -883,7 +885,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused)) glTranslatef(translation[0], translation[1], 0); /* draw an inner brush */ - if (ups->draw_pressure && BKE_brush_use_size_pressure(scene, brush)) { + if (ups->stroke_active && BKE_brush_use_size_pressure(scene, brush)) { /* inner at full alpha */ glutil_draw_lined_arc(0.0, M_PI * 2.0, final_radius * ups->pressure_value, 40); /* outer at half alpha */ |