diff options
author | Severin <eiseljulian@gmail.com> | 2018-06-30 01:42:19 +0300 |
---|---|---|
committer | Severin <eiseljulian@gmail.com> | 2018-06-30 01:42:19 +0300 |
commit | a55b00b53baf2e202b88cbea0f61a232ff9843d3 (patch) | |
tree | 60ec0e0b08e4aeaf7afeab08a5d281b97c2150ba /source/blender/editors/screen/screen_edit.c | |
parent | 48ad67ef8201f8fcd5efdf748c5fea86e2c61d7d (diff) |
Fix a number of small errors in area coordinate handling
For example collapsing the lower part of the topbar with 2x interface scale
would hide the top-bar header region. There were also more asserts when changing
window size and moving area edges afterwards (same assert as in T55298).
Fixes are similar to e626998a262ebe4f.
With all the recent fixes I've done, area geometry handling should be stable
again. Let's hope I'm right :)
Diffstat (limited to 'source/blender/editors/screen/screen_edit.c')
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index c3d18abc2cf..b3424ae3fb4 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -718,7 +718,7 @@ static void screen_vertices_scale( /* adjust headery if verts are along the edge of window */ if (sa->v1->vec.y > window_rect->ymin) headery += U.pixelsize; - if (sa->v2->vec.y < window_rect->ymax) + if (sa->v2->vec.y < (window_rect->ymax - 1)) headery += U.pixelsize; if (area_geometry_height(sa) < headery) { @@ -744,21 +744,32 @@ static void screen_vertices_scale( /* Global areas have a fixed size that only changes with the DPI. Here we ensure that exactly this size is set. */ for (ScrArea *area = win->global_areas.areabase.first; area; area = area->next) { + int height = ED_area_global_size_y(area) - 1; + if (area->global->flag & GLOBAL_AREA_IS_HIDDEN) { continue; } + + if (area->v1->vec.y > window_rect->ymin) { + height += U.pixelsize; + } + if (area->v2->vec.y < (window_rect->ymax - 1)) { + height += U.pixelsize; + } + /* width */ area->v1->vec.x = area->v2->vec.x = window_rect->xmin; area->v3->vec.x = area->v4->vec.x = window_rect->xmax - 1; /* height */ area->v1->vec.y = area->v4->vec.y = window_rect->ymin; area->v2->vec.y = area->v3->vec.y = window_rect->ymax - 1; + switch (area->global->align) { case GLOBAL_AREA_ALIGN_TOP: - area->v1->vec.y = area->v4->vec.y = area->v2->vec.y - ED_area_global_size_y(area); + area->v1->vec.y = area->v4->vec.y = area->v2->vec.y - height; break; case GLOBAL_AREA_ALIGN_BOTTOM: - area->v2->vec.y = area->v3->vec.y = area->v1->vec.y + ED_area_global_size_y(area); + area->v2->vec.y = area->v3->vec.y = area->v1->vec.y + height; break; } } |