From aeef812440ca21f4f70f53ebc80afad83a8c4ba7 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Mon, 17 Sep 2007 11:07:21 +0000 Subject: * Tiny tweak to 'set border render (shift B)'. It was always annoying to have no hotkey to disable render border, having to switch to render buttons to disable it even though you used a hotkey shift B to enable it. This change makes it so that if you drag the border to cover the entire camera view, it will automatically disable border rendering. --- source/blender/src/editview.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'source/blender/src/editview.c') diff --git a/source/blender/src/editview.c b/source/blender/src/editview.c index 176821e0cc9..bd90d887cd0 100644 --- a/source/blender/src/editview.c +++ b/source/blender/src/editview.c @@ -2063,15 +2063,23 @@ void set_render_border(void) G.scene->r.border.ymin= ((float)rect.ymin-vb.ymin)/(vb.ymax-vb.ymin); G.scene->r.border.xmax= ((float)rect.xmax-vb.xmin)/(vb.xmax-vb.xmin); G.scene->r.border.ymax= ((float)rect.ymax-vb.ymin)/(vb.ymax-vb.ymin); - + CLAMP(G.scene->r.border.xmin, 0.0, 1.0); CLAMP(G.scene->r.border.ymin, 0.0, 1.0); CLAMP(G.scene->r.border.xmax, 0.0, 1.0); CLAMP(G.scene->r.border.ymax, 0.0, 1.0); - + allqueue(REDRAWVIEWCAM, 1); - /* if it was not set, we do this */ - G.scene->r.mode |= R_BORDER; + + /* drawing a border surrounding the entire camera view switches off border rendering */ + if (G.scene->r.border.xmin <= 0.0 && G.scene->r.border.xmax >= 1.0 && + G.scene->r.border.ymin <= 0.0 && G.scene->r.border.ymax >= 1.0) + { + G.scene->r.mode &= ~R_BORDER; + } else { + G.scene->r.mode |= R_BORDER; + } + allqueue(REDRAWBUTSSCENE, 1); } } -- cgit v1.2.3