fill zone obstacles on x/y axis during useful geometry recalc

this fixes an issue where shrinking vertical shelves would cause vertically
maximized windows to always match the height of the shelf

possibly needs improving later depending on usage of zone obstacles in
the future...
This commit is contained in:
Mike Blumenkrantz 2016-01-25 13:45:47 -05:00
parent ea2ec5a2f3
commit 10c43efc83
1 changed files with 8 additions and 2 deletions

View File

@ -1239,7 +1239,10 @@ _e_zone_useful_geometry_calc(const E_Zone *zone, int dx, int dy, int *x, int *y,
EINA_INLIST_FOREACH(zone->obstacles, obs)
{
if (!E_INTERSECTS(obs->x, obs->y, obs->w, obs->h, zx, zy, zw, zh)) continue;
eina_tiler_rect_del(tiler, &(Eina_Rectangle){obs->x - zx, obs->y - zy, obs->w, obs->h});
if (obs->w >= obs->h)
eina_tiler_rect_del(tiler, &(Eina_Rectangle){0, obs->y - zy, zw, obs->h});
else
eina_tiler_rect_del(tiler, &(Eina_Rectangle){obs->x - zx, 0, obs->w, zh});
}
desk = e_desk_at_xy_get(zone, dx, dy);
if (desk)
@ -1247,7 +1250,10 @@ _e_zone_useful_geometry_calc(const E_Zone *zone, int dx, int dy, int *x, int *y,
EINA_INLIST_FOREACH(desk->obstacles, obs)
{
if (!E_INTERSECTS(obs->x, obs->y, obs->w, obs->h, zx, zy, zw, zh)) continue;
eina_tiler_rect_del(tiler, &(Eina_Rectangle){obs->x - zx, obs->y - zy, obs->w, obs->h});
if (obs->w >= obs->h)
eina_tiler_rect_del(tiler, &(Eina_Rectangle){0, obs->y - zy, zw, obs->h});
else
eina_tiler_rect_del(tiler, &(Eina_Rectangle){obs->x - zx, 0, obs->w, zh});
}
}
it = eina_tiler_iterator_new(tiler);