diff options
author | Ton Roosendaal <ton@blender.org> | 2012-12-16 18:19:29 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2012-12-16 18:19:29 +0400 |
commit | 7965b6995edfb8cf8bfd04dbf2114ca6b23ddd5a (patch) | |
tree | 38e00615df02a58ba9c232e3ac1422bfb5cff242 /source/blender/editors/screen | |
parent | 54787a885551b15e143db59c9268e5b4e6418039 (diff) |
Bug fix 33563
Region sizex/sizey should store the actual used sizes, for hide/reveal.
Didn't happen correctly, resulting in opening button regions of size 1.
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r-- | source/blender/editors/screen/area.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 932414ffaba..766d114093e 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -944,7 +944,7 @@ static void region_rect_recursive(wmWindow *win, ScrArea *sa, ARegion *ar, rcti alignment = RGN_ALIGN_NONE; /* prefsize, for header we stick to exception */ - prefsizex = ar->sizex ? ar->sizex : UI_DPI_FAC * ar->type->prefsizex; + prefsizex = ar->sizex > 1 ? ar->sizex : UI_DPI_FAC * ar->type->prefsizex; if (ar->regiontype == RGN_TYPE_HEADER) { prefsizey = ED_area_headersize(); } @@ -952,7 +952,7 @@ static void region_rect_recursive(wmWindow *win, ScrArea *sa, ARegion *ar, rcti prefsizey = UI_UNIT_Y * 2 + (UI_UNIT_Y / 2); } else { - prefsizey = ar->sizey ? ar->sizey : UI_DPI_FAC * ar->type->prefsizey; + prefsizey = ar->sizey > 1 ? ar->sizey : UI_DPI_FAC * ar->type->prefsizey; } @@ -1091,6 +1091,10 @@ static void region_rect_recursive(wmWindow *win, ScrArea *sa, ARegion *ar, rcti ar->winx = BLI_rcti_size_x(&ar->winrct) + 1; ar->winy = BLI_rcti_size_y(&ar->winrct) + 1; + /* if region opened normally, we store this for hide/reveal usage */ + if (ar->winx > 1) ar->sizex = ar->winx; + if (ar->winy > 1) ar->sizey = ar->winy; + /* exception for multiple aligned overlapping regions on same spot */ if (ar->overlap) region_overlap_fix(ar); @@ -1298,6 +1302,8 @@ void region_toggle_hidden(bContext *C, ARegion *ar, int do_fade) ar->flag ^= RGN_FLAG_HIDDEN; + printf("%d\n", ar->winx); + if (do_fade && ar->overlap) { /* starts a timer, and in end calls the stuff below itself (region_sblend_invoke()) */ region_blend_start(C, sa, ar); |