diff options
author | Ton Roosendaal <ton@blender.org> | 2012-12-26 17:57:07 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2012-12-26 17:57:07 +0400 |
commit | 86134fd8c6056a568531fff7f71afe95450d97ec (patch) | |
tree | 1b52233808f8d5e4c854abed71dab765aab3d3cc /source/blender/editors/interface/interface_regions.c | |
parent | 41753f4fddc69bee7b45baef79dff02288b0aeae (diff) |
Bug fix #33633 (and irc report)
The function ui_popup_block_clip() didn't correct the buttons if a clip
happened, causing the items to draw outside.
Diffstat (limited to 'source/blender/editors/interface/interface_regions.c')
-rw-r--r-- | source/blender/editors/interface/interface_regions.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 57c126c31c5..a1ad7d6aaa7 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -1527,6 +1527,7 @@ static void ui_block_region_draw(const bContext *C, ARegion *ar) static void ui_popup_block_clip(wmWindow *window, uiBlock *block) { + uiBut *bt; int width = UI_ThemeMenuShadowWidth(); int winx, winy; @@ -1536,7 +1537,6 @@ static void ui_popup_block_clip(wmWindow *window, uiBlock *block) winx = WM_window_pixels_x(window); winy = WM_window_pixels_y(window); - // wm_window_get_size(window, &winx, &winy); if (block->rect.xmin < width) block->rect.xmin = width; @@ -1547,6 +1547,15 @@ static void ui_popup_block_clip(wmWindow *window, uiBlock *block) block->rect.ymin = width; if (block->rect.ymax > winy - MENU_TOP) block->rect.ymax = winy - MENU_TOP; + + /* ensure menu items draw inside left/right boundary */ + for (bt = block->buttons.first; bt; bt = bt->next) { + if (bt->rect.xmin < block->rect.xmin) + bt->rect.xmin = block->rect.xmin; + if (bt->rect.xmax > block->rect.xmax) + bt->rect.xmax = block->rect.xmax; + } + } void ui_popup_block_scrolltest(uiBlock *block) |