preview method
List<(EntityKind, GeometryPayload)>
preview(
- DraftDocument d,
- Handle group,
- Grip grip,
- Vector2 world,
What drag would draw, in world: the pieces a reshape preview paints,
computed once per pointer move, never per frame. Empty when there is
nothing to show. world is only read during the call.
Implementation
@override
List<(EntityKind, GeometryPayload)> preview(
DraftDocument d, Handle group, Grip grip, Vector2 world) {
final s = _Slide.of(d, group);
if (s == null) return const [];
final cut = s.place(world, edgeAperture()).cut;
if (cut == null) return const [];
final f = s.layout.frame;
return [
for (final u in [cut.a, cut.b])
(
EntityKind.line,
linePayload(s.world(u, f.lOff), s.world(u, f.rOff)),
),
];
}