UI: Revert fix T37463: Y-clamp for header-only spaces

This reverts 91d8519c47 since I can't redo the reported error
which was in the old header-only info space.
This commit is contained in:
Campbell Barton 2019-04-18 21:19:49 +02:00
parent bd7d39f0b9
commit e8c9e85401
Notes: blender-bot 2023-02-14 11:35:48 +01:00
Referenced by commit 4d1128872e, UI: keep timeline collapsed to header size when resizing window
Referenced by issue #37463, Maximizing window causes info panel to open partially
2 changed files with 1 additions and 82 deletions

View File

@ -152,10 +152,6 @@ ScrEdge *screen_geom_find_active_scredge(const wmWindow *win,
*/
void screen_geom_vertices_scale(const wmWindow *win, bScreen *sc)
{
/* clamp Y size of header sized areas when expanding windows
* avoids annoying empty space around file menu */
#define USE_HEADER_SIZE_CLAMP
rcti window_rect, screen_rect;
WM_window_rect_calc(win, &window_rect);
@ -181,33 +177,6 @@ void screen_geom_vertices_scale(const wmWindow *win, bScreen *sc)
screen_size_x_prev = (max[0] - min[0]) + 1;
screen_size_y_prev = (max[1] - min[1]) + 1;
#ifdef USE_HEADER_SIZE_CLAMP
# define TEMP_BOTTOM 1
# define TEMP_TOP 2
/* if the window's Y axis grows, clamp header sized areas */
if (screen_size_y_prev < screen_size_y) { /* growing? */
const int headery_margin_max = headery_init + 5;
for (sa = sc->areabase.first; sa; sa = sa->next) {
ARegion *ar = BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
sa->temp = 0;
if (ar && !(ar->flag & RGN_FLAG_HIDDEN)) {
if (sa->v2->vec.y == max[1]) {
if (screen_geom_area_height(sa) < headery_margin_max) {
sa->temp = TEMP_TOP;
}
}
else if (sa->v1->vec.y == min[1]) {
if (screen_geom_area_height(sa) < headery_margin_max) {
sa->temp = TEMP_BOTTOM;
}
}
}
}
}
#endif
if (screen_size_x_prev != screen_size_x || screen_size_y_prev != screen_size_y) {
const float facx = ((float)screen_size_x - 1) / ((float)screen_size_x_prev - 1);
const float facy = ((float)screen_size_y - 1) / ((float)screen_size_y_prev - 1);
@ -222,56 +191,6 @@ void screen_geom_vertices_scale(const wmWindow *win, bScreen *sc)
}
}
#ifdef USE_HEADER_SIZE_CLAMP
if (screen_size_y_prev < screen_size_y) { /* growing? */
for (sa = sc->areabase.first; sa; sa = sa->next) {
ScrEdge *se = NULL;
if (sa->temp == 0)
continue;
if (sa->v1 == sa->v2)
continue;
/* adjust headery if verts are along the edge of window */
if (sa->temp == TEMP_TOP) {
/* lower edge */
const int yval = sa->v2->vec.y - headery_init;
se = BKE_screen_find_edge(sc, sa->v4, sa->v1);
if (se != NULL) {
screen_geom_select_connected_edge(win, se);
}
for (sv = sc->vertbase.first; sv; sv = sv->next) {
if (sv != sa->v2 && sv != sa->v3) {
if (sv->flag) {
sv->vec.y = yval;
}
}
}
}
else {
/* upper edge */
const int yval = sa->v1->vec.y + headery_init;
se = BKE_screen_find_edge(sc, sa->v2, sa->v3);
if (se != NULL) {
screen_geom_select_connected_edge(win, se);
}
for (sv = sc->vertbase.first; sv; sv = sv->next) {
if (sv != sa->v1 && sv != sa->v4) {
if (sv->flag) {
sv->vec.y = yval;
}
}
}
}
}
}
# undef USE_HEADER_SIZE_CLAMP
# undef TEMP_BOTTOM
# undef TEMP_TOP
#endif
/* test for collapsed areas. This could happen in some blender version... */
/* ton: removed option now, it needs Context... */

View File

@ -344,7 +344,7 @@ typedef struct ScrArea {
* runtime variable, updated by executing operators.
*/
short region_active_win;
char temp, _pad;
char _pad[2];
/** Callbacks for this space type. */
struct SpaceType *type;