[fix] resize should now preserve surrounding container's dimensions

- prior to this modification, the requested pixels were added/removed
  to both edges of the modified container. To preserve sizes,
  only half the pixels should be added/removed to each edge.
master
wil 8 years ago
parent f7269684d0
commit 3c84250be8

@ -175,15 +175,15 @@ static bool resize_tiled(int amount, bool use_width) {
} else { } else {
if (use_major) { if (use_major) {
for (int j = i; j < next_i; ++j) { for (int j = i; j < next_i; ++j) {
recursive_resize(parent->children->items[j], pixels, recursive_resize(parent->children->items[j], pixels / 2,
use_width ? WLC_RESIZE_EDGE_LEFT : WLC_RESIZE_EDGE_TOP); use_width ? WLC_RESIZE_EDGE_LEFT : WLC_RESIZE_EDGE_TOP);
recursive_resize(parent->children->items[j], pixels, recursive_resize(parent->children->items[j], pixels / 2,
use_width ? WLC_RESIZE_EDGE_RIGHT : WLC_RESIZE_EDGE_BOTTOM); use_width ? WLC_RESIZE_EDGE_RIGHT : WLC_RESIZE_EDGE_BOTTOM);
} }
} else { } else {
recursive_resize(sibling, pixels, recursive_resize(sibling, pixels / 2,
use_width ? WLC_RESIZE_EDGE_LEFT : WLC_RESIZE_EDGE_TOP); use_width ? WLC_RESIZE_EDGE_LEFT : WLC_RESIZE_EDGE_TOP);
recursive_resize(sibling, pixels, recursive_resize(sibling, pixels / 2,
use_width ? WLC_RESIZE_EDGE_RIGHT : WLC_RESIZE_EDGE_BOTTOM); use_width ? WLC_RESIZE_EDGE_RIGHT : WLC_RESIZE_EDGE_BOTTOM);
} }
} }

Loading…
Cancel
Save