diff options
author | Matt Ebb <matt@mke3.net> | 2007-09-17 15:07:21 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2007-09-17 15:07:21 +0400 |
commit | aeef812440ca21f4f70f53ebc80afad83a8c4ba7 (patch) | |
tree | 125f0be63e4e9d8b2509c069c9f2c4d08cd98348 | |
parent | 8bfbccb3292d3a6a5c182768c91ae293906f09d4 (diff) |
* 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.
-rw-r--r-- | source/blender/src/editview.c | 16 |
1 files changed, 12 insertions, 4 deletions
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); } } |