Small fix: Triple Buffer mode didn't clip custom paint cursors correctly
for overlapping regions (example, view3d paint circle drawing into toolbar)
This commit is contained in:
Ton Roosendaal 2009-07-19 12:15:20 +00:00
parent 26ec00d567
commit f72018ebeb
4 changed files with 26 additions and 3 deletions

@ -50,6 +50,7 @@ void ED_region_do_listen(struct ARegion *ar, struct wmNotifier *note);
void ED_region_do_draw(struct bContext *C, struct ARegion *ar);
void ED_region_exit(struct bContext *C, struct ARegion *ar);
void ED_region_pixelspace(struct ARegion *ar);
void ED_region_set(const struct bContext *C, struct ARegion *ar);
void ED_region_init(struct bContext *C, struct ARegion *ar);
void ED_region_tag_redraw(struct ARegion *ar);
void ED_region_tag_redraw_partial(struct ARegion *ar, struct rcti *rct);

@ -273,6 +273,28 @@ static void region_scissor_winrct(ARegion *ar, rcti *winrct)
}
}
/* only exported for WM */
/* makes region ready for drawing, sets pixelspace */
void ED_region_set(const bContext *C, ARegion *ar)
{
wmWindow *win= CTX_wm_window(C);
ScrArea *sa= CTX_wm_area(C);
rcti winrct;
/* checks other overlapping regions */
region_scissor_winrct(ar, &winrct);
ar->drawrct= winrct;
/* note; this sets state, so we can use wmOrtho and friends */
wmSubWindowScissorSet(win, ar->swinid, &ar->drawrct);
UI_SetTheme(sa?sa->spacetype:0, ar->type?ar->type->regionid:0);
ED_region_pixelspace(ar);
}
/* only exported for WM */
void ED_region_do_draw(bContext *C, ARegion *ar)
{

@ -574,8 +574,8 @@ static void wm_method_draw_triple(bContext *C, wmWindow *win)
CTX_wm_area_set(C, sa);
CTX_wm_region_set(C, ar);
wmSubWindowSet(win, ar->swinid);
ED_region_pixelspace(ar);
/* make region ready for draw, scissor, pixelspace */
ED_region_set(C, ar);
wm_paintcursor_draw(C, ar);
CTX_wm_region_set(C, NULL);

@ -236,7 +236,7 @@ static void wm_gesture_draw_cross(wmWindow *win, wmGesture *gt)
glDisable(GL_LINE_STIPPLE);
}
/* called in wm_event_system.c */
/* called in wm_draw.c */
void wm_gesture_draw(wmWindow *win)
{
wmGesture *gt= (wmGesture *)win->gesture.first;