Fix #19431: gestures would sometimes draw incorrect, now ensures they

are always drawn in pixel space.
This commit is contained in:
Brecht Van Lommel
2009-12-17 19:55:08 +00:00
parent 0c813b2a0e
commit 53edaee89b
4 changed files with 13 additions and 1 deletions

View File

@@ -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);

View File

@@ -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) {

View File

@@ -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);

View File

@@ -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 ********************** */