diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-12-17 22:55:08 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-12-17 22:55:08 +0300 |
commit | 53edaee89b6512f1d4d01ed5f83a9d335d104257 (patch) | |
tree | bac4fc0bcb7e237ba129bfcdf243ebe3d184a0fb | |
parent | 0c813b2a0ee4e293428caa3fc7d2b706377c92cf (diff) |
Fix #19431: gestures would sometimes draw incorrect, now ensures they
are always drawn in pixel space.
-rw-r--r-- | source/blender/windowmanager/WM_api.h | 1 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_draw.c | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_gesture.c | 1 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_subwindow.c | 10 |
4 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index e90360fde45..c4270fbc8b0 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -264,6 +264,7 @@ void wmPopMatrix (void); /* one level only */ void wmFrustum (float x1, float x2, float y1, float y2, float n, float f); void wmOrtho (float x1, float x2, float y1, float y2, float n, float f); void wmOrtho2 (float x1, float x2, float y1, float y2); +void wmOrthoPixelSpace (void); /* utilities */ void WM_set_framebuffer_index_color(int index); diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index b9e6ca2d281..9ee67cd4047 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -585,7 +585,7 @@ static void wm_method_draw_triple(bContext *C, wmWindow *win) } } - if(win->screen->do_draw_gesture) + if(screen->do_draw_gesture) wm_gesture_draw(win); if(wm->paintcursors.first) { diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c index 882da1794c6..b95d171c1b0 100644 --- a/source/blender/windowmanager/intern/wm_gesture.c +++ b/source/blender/windowmanager/intern/wm_gesture.c @@ -248,6 +248,7 @@ void wm_gesture_draw(wmWindow *win) for(; gt; gt= gt->next) { /* all in subwindow space */ wmSubWindowSet(win, gt->swinid); + wmOrthoPixelSpace(); if(gt->type==WM_GESTURE_RECT) wm_gesture_draw_rect(win, gt); diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c index 00af9eb0bb9..decf1f0d676 100644 --- a/source/blender/windowmanager/intern/wm_subwindow.c +++ b/source/blender/windowmanager/intern/wm_subwindow.c @@ -405,6 +405,16 @@ void wmOrtho2(float x1, float x2, float y1, float y2) wmOrtho(x1, x2, y1, y2, -100, 100); } +void wmOrthoPixelSpace(void) +{ + if(_curswin) { + int width, height; + + wm_subwindow_getsize(_curwindow, _curswin->swinid, &width, &height); + wmOrtho2(-0.375, (float)width-0.375, -0.375, (float)height-0.375); + wmLoadIdentity(); + } +} /* *************************** Framebuffer color depth, for selection codes ********************** */ |