From f72018ebeb841c9aa677b4f51e1d28a56e8565a7 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sun, 19 Jul 2009 12:15:20 +0000 Subject: 2.5 Small fix: Triple Buffer mode didn't clip custom paint cursors correctly for overlapping regions (example, view3d paint circle drawing into toolbar) --- source/blender/editors/screen/area.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source/blender/editors/screen/area.c') diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index e84aab787c1..cdb4322d7f2 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -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) { -- cgit v1.2.3