discontinuedPackage jet_cad_floor_plan has been discontinued and replaced by jet_cad_2d_plan.

preview method

  1. @override
List<(EntityKind, GeometryPayload)> preview(
  1. DraftDocument d,
  2. Handle group,
  3. Grip grip,
  4. 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) {
  _syncMemo(d, group, grip.index);
  final s = _memoDim;
  if (s == null) return const [];
  final next = _dropped(d, s, grip.index, world, _memoThickest, _memoPoints);
  if (next == null) return const [];
  final p = next.params;
  final l =
      layoutDimension(next.p0, next.p1, p.kind, s.m, p.offset, _pageOf(d));
  if (l == null) return const [];
  return [
    for (final (a, b) in [(l.q0, l.q1), l.ext0, l.ext1, l.slash0, l.slash1])
      (EntityKind.line, linePayload(a, b)),
  ];
}