diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-04-04 19:15:45 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-04-04 19:15:45 +0400 |
commit | e8ea4411f82c7ffc5730d1b7142f33bc90e0e03a (patch) | |
tree | fb07c9257b1aaf8a625f422e77342db6c477d1bf /source/blender/editors/sculpt_paint | |
parent | 25976b7b87a6e4a2fdf0d78db9a996c0c7621b8a (diff) |
Fix for redraw issues when making fast strokes with grab tool in sculpt mode
Join redraw rectangles from previous step and current during one stroke
and reset previous rectangle when stroke is finished. This shouldn't cause problems
with viewport changes during the sculpt session and this should emulate
object boundbox merging for states "before step" and "after step".
At leastm it's more logical because boundbox could not only grow up during
stroke, but it could also shrink down.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 225852b951e..9d9deeda604 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -263,6 +263,8 @@ typedef struct StrokeCache { int alt_smooth; float plane_trim_squared; + + rcti previous_r; /* previous redraw rectangle */ } StrokeCache; /*** BVH Tree ***/ @@ -3403,19 +3405,19 @@ static void sculpt_flush_update(bContext *C) BLI_pbvh_update(ss->pbvh, PBVH_UpdateBB, NULL); if (sculpt_get_redraw_rect(ar, CTX_wm_region_view3d(C), ob, &r)) { - //rcti tmp; - r.xmin += ar->winrct.xmin + 1; r.xmax += ar->winrct.xmin - 1; r.ymin += ar->winrct.ymin + 1; r.ymax += ar->winrct.ymin - 1; - //tmp = r; + if (ss->cache) { + rcti tmp = r; - //if (!BLI_rcti_is_empty(&ss->previous_r)) - // BLI_union_rcti(&r, &ss->previous_r); + if (!BLI_rcti_is_empty(&ss->cache->previous_r)) + BLI_union_rcti(&r, &ss->cache->previous_r); - //ss->previous_r= tmp; + ss->cache->previous_r= tmp; + } ss->partial_redraw = 1; ED_region_tag_redraw_partial(ar, &r); |