diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-01-04 17:46:29 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-01-04 17:46:29 +0300 |
commit | df29715498a2e601f1c57ff68b168e5984ef6491 (patch) | |
tree | ae805a7abcffd1bddbe4542146c3bdcfff7f4318 /source/blender/editors | |
parent | 8b1bfbcfea8af306dbf42743b5f67d46159015c5 (diff) |
Fix #25483: Brush appearance color
Set special brush flag when inversion stroke was started, not wery nice, but
we can't make better with current events system implementation.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_stroke.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 14 |
2 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index ea99844bfac..ccbaa3f5b57 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -591,7 +591,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *unused) brush_set_size(brush, pixel_radius); // XXX: no way currently to know state of pen flip or invert key modifier without starting a stroke - flip = 1; + flip = brush->flag & BRUSH_INVERTED ? -1 : 1; sign = flip * ((brush->flag & BRUSH_DIR_IN)? -1 : 1); diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 55c7247650a..15d940cc8a3 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -2904,6 +2904,11 @@ static void sculpt_update_cache_invariants(bContext* C, Sculpt *sd, SculptSessio cache->invert = mode == WM_BRUSHSTROKE_INVERT; cache->alt_smooth = mode == WM_BRUSHSTROKE_SMOOTH; + /* not very nice, but with current events system implementation + we can't handle brush appearance inversion hotkey separately (sergey) */ + if(cache->invert) brush->flag |= BRUSH_INVERTED; + else brush->flag &= ~BRUSH_INVERTED; + /* Alt-Smooth */ if (ss->cache->alt_smooth) { Paint *p= &sd->paint; @@ -3452,14 +3457,17 @@ static void sculpt_stroke_done(bContext *C, struct PaintStroke *unused) /* Finished */ if(ss->cache) { + Brush *brush= paint_brush(&sd->paint); + brush->flag &= ~BRUSH_INVERTED; + sculpt_stroke_modifiers_check(C, ss); /* Alt-Smooth */ if (ss->cache->alt_smooth) { Paint *p= &sd->paint; - Brush *br= (Brush *)find_id("BR", ss->cache->saved_active_brush_name); - if(br) { - paint_brush_set(p, br); + brush= (Brush *)find_id("BR", ss->cache->saved_active_brush_name); + if(brush) { + paint_brush_set(p, brush); } } |