diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-10-04 17:40:41 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-10-04 17:41:28 +0400 |
commit | 4f9ee695ef97742b2828daae98e55cd9050e16f2 (patch) | |
tree | 20f39fc0d7633aba64754be44f1db76fb61cdecd | |
parent | 27d660ad20a57a8f688890a04d2eb629e39a3f19 (diff) |
Fix off by one error drawing passepartout
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index c9d33e5cde9..61bfb0176ef 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1091,6 +1091,9 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d) /* passepartout, specified in camera edit buttons */ if (ca && (ca->flag & CAM_SHOWPASSEPARTOUT) && ca->passepartalpha > 0.000001f) { + const float winx = (ar->winx + 1); + const float winy = (ar->winy + 1); + if (ca->passepartalpha == 1.0f) { glColor3f(0, 0, 0); } @@ -1100,11 +1103,11 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d) glColor4f(0, 0, 0, ca->passepartalpha); } if (x1i > 0.0f) - glRectf(0.0, (float)ar->winy, x1i, 0.0); - if (x2i < (float)ar->winx) - glRectf(x2i, (float)ar->winy, (float)ar->winx, 0.0); - if (y2i < (float)ar->winy) - glRectf(x1i, (float)ar->winy, x2i, y2i); + glRectf(0.0, winy, x1i, 0.0); + if (x2i < winx) + glRectf(x2i, winy, winx, 0.0); + if (y2i < winy) + glRectf(x1i, winy, x2i, y2i); if (y2i > 0.0f) glRectf(x1i, y1i, x2i, 0.0); |