-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
Description
There is the following longstanding deficiency:
Currently, not only snapped window edges are considered as connected, but even edges which are only on the same row/column are considered as connected. I have not decided yet if this is a bug or a feature.
A not too inefficient algorithm to find exactly those windows that transitively touch the moved edge might look as follows; we assume a vertical edge is moved:
- Let W be the set of all windows.
- Let S = {the resized window}.
- Let TODO = W ∖ S.
- Let x be the current horizontal position of the moved vertical edge.
- Let l be the vertical position of the lower edge of the resized window.
- Let u be the vertical position of the upper edge of the resized window.
- While TODO ≠ ∅:
- Choose c ∈ TODO.
- TODO = TODO ∖ c.
- If c has a vertical edge that has horizontal position x and that touches the interval (l, u), then:
- Let S = S ∪ {c}.
- Let l = min(l, vertical position of the lower edge of c).
- Let u = max(u, vertical position of the upper edge of c).
- Let TODO = W ∖ S.
- Now S should contain exactly those windows that transitively stick to the moved edge.
Runtime presumably is in O(|W|²).