diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-08-05 08:52:27 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-08-05 08:52:27 +0400 |
commit | 0395b8eee8aeaac33d42e0e560412baebacc6248 (patch) | |
tree | c464ec302888052611568d4a065ea49e55c9cd5f /source/blender/editors/screen/area.c | |
parent | 37ff3a0e8a3d47943d8f73a21f0551dfc5587009 (diff) |
border render with cycles had 1 pixel offset on the top-right edge of the image, issue was caused by wmSubWindowScissorSet adding 1 to the ar->drawrct, now only add the padding when drawing the entire area
Diffstat (limited to 'source/blender/editors/screen/area.c')
-rw-r--r-- | source/blender/editors/screen/area.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 27b519c4355..e805b3f30fc 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -387,7 +387,7 @@ void ED_region_set(const bContext *C, ARegion *ar) ar->drawrct = ar->winrct; /* note; this sets state, so we can use wmOrtho and friends */ - wmSubWindowScissorSet(win, ar->swinid, &ar->drawrct); + wmSubWindowScissorSet(win, ar->swinid, &ar->drawrct, true); UI_SetTheme(sa ? sa->spacetype : 0, ar->type ? ar->type->regionid : 0); @@ -401,21 +401,25 @@ void ED_region_do_draw(bContext *C, ARegion *ar) wmWindow *win = CTX_wm_window(C); ScrArea *sa = CTX_wm_area(C); ARegionType *at = ar->type; - + bool scissor_pad; + /* see BKE_spacedata_draw_locks() */ if (at->do_lock) return; /* if no partial draw rect set, full rect */ - if (ar->drawrct.xmin == ar->drawrct.xmax) + if (ar->drawrct.xmin == ar->drawrct.xmax) { ar->drawrct = ar->winrct; + scissor_pad = true; + } else { /* extra clip for safety */ BLI_rcti_isect(&ar->winrct, &ar->drawrct, &ar->drawrct); + scissor_pad = false; } /* note; this sets state, so we can use wmOrtho and friends */ - wmSubWindowScissorSet(win, ar->swinid, &ar->drawrct); + wmSubWindowScissorSet(win, ar->swinid, &ar->drawrct, scissor_pad); UI_SetTheme(sa ? sa->spacetype : 0, at->regionid); |