| 138 | } |
| 139 | |
| 140 | protected void abut() { |
| 141 | List<Box> s = selected().sorted((a, b) -> Float.compare(a.properties.get(Box.frame).x, b.properties.get(Box.frame).x)) |
| 142 | .collect(Collectors.toList()); |
| 143 | float ax = s.get(0).properties.get(Box.frame).x + s.get(0).properties.get(Box.frame).w; |
| 144 | for (int i = 1; i < s.size(); i++) { |
| 145 | final float finalAx = ax; |
| 146 | set(s.get(i), z -> { |
| 147 | z.x = finalAx; |
| 148 | }); |
| 149 | ax = s.get(i).properties.get(Box.frame).x + s.get(i).properties.get(Box.frame).w; |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | private void set(Box b, Consumer<Rect> r) { |
| 154 | Callbacks.frameModified(b, r); |