diff options
author | Ton Roosendaal <ton@blender.org> | 2013-01-25 14:17:06 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2013-01-25 14:17:06 +0400 |
commit | 13a4ad1a624ce30425150ec023323a93671a0310 (patch) | |
tree | 7e593ee98850c8141436da7fe101d2b46e65e705 /source/blender/windowmanager/intern/wm_subwindow.c | |
parent | d4e5dc00f2facdd717ae99373ce7684e2c0d2a35 (diff) |
Bugfix #33989
Transparent region drawing and blend broke by commit 53919 5 days ago.
This commit reverts the change.
The claim in previous commit "edited code for readability" is quite
disputable :) The error is hard to notice even.
I also like to emphasize that people should check with owners for code
before committing changes! Cleaning code is first a job for maintainers.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_subwindow.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_subwindow.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c index 1fbd8a8f5c2..20406ac463d 100644 --- a/source/blender/windowmanager/intern/wm_subwindow.c +++ b/source/blender/windowmanager/intern/wm_subwindow.c @@ -241,8 +241,7 @@ static wmSubWindow *_curswin = NULL; void wmSubWindowScissorSet(wmWindow *win, int swinid, rcti *srct) { - int x, y, width, height; - + int width, height; _curswin = swin_from_swinid(win, swinid); if (_curswin == NULL) { @@ -251,33 +250,26 @@ void wmSubWindowScissorSet(wmWindow *win, int swinid, rcti *srct) } win->curswin = _curswin; - _curwindow = win; - x = _curswin->winrct.xmin; - y = _curswin->winrct.ymin; width = BLI_rcti_size_x(&_curswin->winrct) + 1; height = BLI_rcti_size_y(&_curswin->winrct) + 1; - - glViewport(x, y, width, height); - + glViewport(_curswin->winrct.xmin, _curswin->winrct.ymin, width, height); + if (srct) { - x = srct->xmin; - y = srct->ymin; - width = BLI_rcti_size_x(srct) + 1; - height = BLI_rcti_size_y(srct) + 1; + int width = BLI_rcti_size_x(srct) + 1; /* only here */ + int height = BLI_rcti_size_y(srct) + 1; + glScissor(srct->xmin, srct->ymin, width, height); } - - glScissor(x, y, width, height); + else + glScissor(_curswin->winrct.xmin, _curswin->winrct.ymin, width, height); wmOrtho2(-GLA_PIXEL_OFS, (float)width - GLA_PIXEL_OFS, -GLA_PIXEL_OFS, (float)height - GLA_PIXEL_OFS); - - glLoadIdentity(); /* reset MODELVIEW */ - - glFlush(); /* XXX: jwilkins - is this really needed here? */ + glLoadIdentity(); + + glFlush(); } - /* enable the WM versions of opengl calls */ void wmSubWindowSet(wmWindow *win, int swinid) { |