Class DndCollisions
- Namespace
- Velvet
- Assembly
- Velvet.Docs.dll
The built-in collision strategies: RectIntersection, ClosestCenter, and PointerWithin. All are pure functions over a DndCollisionQuery (no panel access), returning a single winning id or null rather than a ranked collision list — the context only ever consumes the first collision anyway, and the delegate's return can be extended compatibly later. None of them consider occlusion; all are rect-based only.
public static class DndCollisions
- Inheritance
-
objectDndCollisions
Fields
- ClosestCenter
Droppable whose center is nearest ActiveRect's center wins — the forgiving strategy sortable lists and coarse grids want. Every candidate collides by definition, so this never returns null while any candidate exists.
- PointerWithin
Droppable rect containing the pointer wins; on nesting, the innermost (smallest area) container takes it.
- RectIntersection
Largest ActiveRect-droppable intersection area wins. Ties resolve by registration order (first candidate wins).