diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-02-17 00:41:46 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-02-17 16:23:19 +0300 |
commit | 5d3f679013bbbb9f0c7aae47b5653c54266cf7ca (patch) | |
tree | 94c220b77f82e210180673bc17916b1c9ad94d55 /source/blender/editors/interface/interface.c | |
parent | cbd0e09898b3cf9f85d208bcca1d43bb57708f15 (diff) |
Code cleanup: remove WM subwindows.
These no longer made much sense after regions were added, they just
duplicated state that was already in the regions.
Diffstat (limited to 'source/blender/editors/interface/interface.c')
-rw-r--r-- | source/blender/editors/interface/interface.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index d524a03f24d..a4eaf800801 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -69,7 +69,6 @@ #include "WM_api.h" #include "WM_types.h" -#include "wm_subwindow.h" #include "WM_message.h" #include "RNA_access.h" @@ -2853,7 +2852,6 @@ uiBlock *UI_block_begin(const bContext *C, ARegion *region, const char *name, sh uiBlock *block; wmWindow *window; Scene *scn; - int getsizex, getsizey; window = CTX_wm_window(C); scn = CTX_data_scene(C); @@ -2884,22 +2882,22 @@ uiBlock *UI_block_begin(const bContext *C, ARegion *region, const char *name, sh UI_block_region_set(block, region); /* window matrix and aspect */ - if (region && region->swinid) { - wm_subwindow_matrix_get(window, region->swinid, block->winmat); - wm_subwindow_size_get(window, region->swinid, &getsizex, &getsizey); + if (region && region->visible) { + gpuGetProjectionMatrix(block->winmat); - block->aspect = 2.0f / fabsf(getsizex * block->winmat[0][0]); + block->aspect = 2.0f / fabsf(region->winx * block->winmat[0][0]); } else { - const bScreen *screen = WM_window_get_active_screen(window); - /* no subwindow created yet, for menus for example, so we * use the main window instead, since buttons are created * there anyway */ - wm_subwindow_matrix_get(window, screen->mainwin, block->winmat); - wm_subwindow_size_get(window, screen->mainwin, &getsizex, &getsizey); + int width = WM_window_pixels_x(window); + int height = WM_window_pixels_y(window); + rcti winrct = {0, width -1, 0, height - 1}; + + wmGetProjectionMatrix(block->winmat, &winrct); - block->aspect = 2.0f / fabsf(getsizex * block->winmat[0][0]); + block->aspect = 2.0f / fabsf(width * block->winmat[0][0]); block->auto_open = true; block->flag |= UI_BLOCK_LOOP; /* tag as menu */ } |