From 0395b8eee8aeaac33d42e0e560412baebacc6248 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 5 Aug 2013 04:52:27 +0000 Subject: 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 --- source/blender/editors/screen/area.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/screen/area.c') 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); -- cgit v1.2.3