discontinuedPackage jet_cad_floor_plan has been discontinued and replaced by jet_cad_2d_plan.

commitShape method

bool commitShape(
  1. ToolContext ctx,
  2. EntityKind kind,
  3. GeometryPayload payload, {
  4. bool fillable = false,
})
inherited

Spec 05 D13: with Fill on and a fillable shape, one region when the boundary can fill, and the plain boundary when it cannot.

Implementation

bool commitShape(ToolContext ctx, EntityKind kind, GeometryPayload payload,
        {bool fillable = false}) =>
    commit(ctx, () {
      if (fillable && (fill?.value ?? false)) {
        final region = addDraftedRegion(ctx.document, kind, payload,
            layer: drawingLayer(ctx.document));
        if (region != null) return region;
      }
      return addDrafted(ctx.document, kind, payload,
          layer: drawingLayer(ctx.document));
    });