(Window.Event<Window.MouseState> e, boolean termination)
| 222 | |
| 223 | return new Mouse.Dragger() { |
| 224 | @Override |
| 225 | public boolean update(Window.Event<Window.MouseState> e, boolean termination) { |
| 226 | |
| 227 | Vec2 point = new Vec2(e.after.mx, e.after.my); |
| 228 | |
| 229 | Optional<Box> hit = breadthFirst(both()).filter(x -> !x.properties.isTrue(Box.hidden, false)) |
| 230 | .filter(b -> frame(b) != null) |
| 231 | .filter(b -> frame(b).intersects(point)) |
| 232 | .sorted((a, b) -> Float.compare(order(frame(a)), order(frame(b)))) |
| 233 | .findFirst(); |
| 234 | |
| 235 | if (hit.isPresent() && hit.get() != origin) { |
| 236 | showCompleteDrag(origin, hit.get()); |
| 237 | if (termination) { |
| 238 | completeDrag(origin, hit.get()); |
| 239 | } |
| 240 | } else { |
| 241 | showIncompleteDrag(origin, point, false); |
| 242 | if (termination) { |
| 243 | Dispatch.this.properties.removeFromMap(frameDrawing, "__ongoingDrag__"); |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | |
| 248 | return true; |
| 249 | } |
| 250 | |
| 251 | |
| 252 | }; |
nothing calls this directly
no test coverage detected