canvas_core 0.16.0
canvas_core: ^0.16.0 copied to clipboard
Pure-Dart canvas scene model, layout, geometry, serialization, and renderer-independent scene evaluation.
0.16.0 #
- Breaking: require
PathData.sourceand useCanvasAppearancefor path fill/stroke. Paths default to no foreground or configured stroke. - Breaking:
PolylineSourceandCanvasStrokesnapshot caller-supplied lists and are no longerconst. Stroke copies preserve owned dash values. - Breaking: use geometry-only path layout, independent paint bounds, and conservative stroke caps/joins. Pivots and content fitting may change from earlier stroke-expanded layout; invisible paint contributes no bounds.
- Breaking: persist scene format v3. Use
upgradeCanvasScene()for v2, v1, and explicitly identified unversioned 0.10.x inputs, retaining existing icon resolution requirements. Preserve contour breaks and inactive stroke/dash data. - Breaking: replace
validateCanvasSceneDocument, its issue type/enum, andCanvasSceneFormatExceptionwith fail-fastrequireCanvasSceneIntegrityand ordinary errors. Diagnostic codes, paths, and ordering are no longer contracts. - Breaking: remove
LinearGradientSpecConverterand stop exporting internalCanvasFillConverter,PathSourceConverter, andestimatePathPaintBounds. Geometry converter annotations remain public. - Add
CanvasFields.pathStrokeandfillContributesToPaint.
0.15.0 #
- Breaking: replace
ResolvedIconTextandResolvedIconPathwith one filled-vectorResolvedIcon, requiring normalizedCommandPathSourcegeometry, viewBox, and fill rule. Hosts prepare vector resources before synchronous lookup and remove icon-only font registration. InstanceCanvasAppearancesupplies foreground paint and shadows. - Breaking: replace
ComputedScene.iconTextByIdandiconPathIRByIdwithiconById. EachComputedIconexposes source-spacepathIR, the centered uniform viewBox fit insourceToLocal, andfillRule. - Breaking: remove
PathStyle,PathIR.style, and style-bearing compilation. UsePathIR(commands);localBounds()has noincludeStrokeargument and describes geometry only. Ordinary-path paint, fill rule, and stroke properties remain onPathData; evaluated bounds remain in the computed scene. - Breaking: remove the
iconsargument fromcollectSceneFontFamilies(); it discovers text and supplied fallback families. Icons contribute no fonts. - Breaking: remove
SvgPathSource, whose compilation was unimplemented. Rawkind: "svg"sources now fail during decoding. Normalize SVG paths to a supported command source before loading. - Scene JSON compatibility does not promise compatibility with retired icon resources or unchanged artwork, padding, and pixels. Hosts replace font/glyph and styled-path icon resources with the new vector definitions.
- Add immutable, geometry-only
CommandPathSourcewith strict JSON decoding and direct compilation of absolute move/line/quadratic/cubic/close commands. - Reject nonfinite or nonpositive icon sizes before layout and resource lookup, including when an icon resolver is absent or the reference is unresolved.
- Breaking:
PathIRnow snapshots its commands and exposes an unmodifiable list. Its constructor is no longerconst.
0.14.0 #
- Breaking: replace
CanvasRenderPipeline,RenderSnapshot, and the renderer-neutralPaintOppipeline withevaluateScene(preparedScene, services)returningSceneEvaluation. The evaluated scene andComputedScenegeometry are now the inputs to rendering;PathIRremains available for computed path geometry. - Breaking: adopt persisted scene format v2 and replace angle/width linear gradients with explicit target-local start/end points and ordered color stops.
decodeCanvasScene()reads the current v2 format; useupgradeCanvasScene()to migrate supported v1 and identified 0.10.x unversioned scenes while preserving their previous gradient appearance. - Share current linear-gradient semantic checks between strict v2 decoding and in-memory scene validation, including finite and distinct endpoints, stop counts, offset range/order, and ARGB colors. Equal stop offsets remain valid for hard transitions; historical migration rules are unchanged.
0.13.0 #
- Breaking: remove
CanvasFileAssetRef.path. File references now expose the trimmedrawvalue and an optional unconverteduri; native path conversion belongs to the executing host. - Breaking: file-reference
canonicalKeynow equalsraw. A file URI and its converted native path no longer share an implicit cache key. Stored scenesourceRefvalues and the scene format are unchanged. - Breaking: remove
CanvasFitandCanvasViewportPlanner.computeViewport()now accepts one caller-selectedRect2D sourceBoundsand returns a uniformCanvasViewportTransformwithscaleand translation only. - Keep optional uniform scale clamping with recentering and
snapTranslation(); callers now own artboard/content selection, padding, output sizing, and other viewport policy.
0.12.0 #
- Breaking: version persisted Canvas scene JSON with
sceneFormatVersion: 1.encodeCanvasScene()now emits the current scene format version, whiledecodeCanvasScene()rejects missing, malformed, and unsupported versions. - Add
upgradeCanvasScene()for explicitly identifiedcanvas_core 0.10.xunversioned scene JSON. - Migrate legacy text and icon
fill/shadowOffsetdata toCanvasAppearance, remove persisted nodelockedvalues, and preserve historical glyph-versus-path icon shadow behavior through caller-supplied icon rendering knowledge. - Reject unsupported older image
sourcePathpayloads instead of allowing the current image decoder to silently discard their source. - Keep
sceneFormatVersionas persistence metadata outside the runtimeCanvasSceneDocumentmodel.
0.11.0 #
- Breaking: remove the optional
idGenparameter fromSceneTreeOps.duplicateSubtree()and removecreatedIdsfrom its result. Subtree duplication now generates deterministic copy-style node IDs while skipping IDs already used by the document or the new copy. - Reject blank, duplicate, or colliding node IDs when adding subtrees, and
guard structural
replaceById()operations against invalid replacement IDs while preserving ordinary property updates and subtree moves. - Breaking: remove persisted canvas-object locking from all
Nodevariants and removeNodeEditingX.withLocked(). Encoded scenes no longer emit alockedfield. - Breaking: remove the built-in lock veto from scene-tree transform operations. Replace-transform, translate, rotate, and uniform scale now operate on any existing node.
- Breaking: replace
ComputedScene.localBoundsByIdandComputedScene.visualBoundsWorldByIdwith explicitlayoutBoundsLocalById,paintBoundsLocalById, andpaintBoundsWorldByIdmaps. - Breaking: remove
ComputedScene.inverseWorldById. Editor-owned inverse transforms and world layout bounds now live incanvas_editor_flutter. - Separate stable layout geometry from paint-bound estimates so effects and content fitting can expand paint bounds without changing transform pivots, selection, snapping, or manipulation geometry.
- Breaking: replace
TextData.fill,TextData.shadowOffset,CanvasIconData.fill, andCanvasIconData.shadowOffsetwith the sharedCanvasAppearancemodel. - Add ordered
CanvasSourceUnderlayvalues with stable serialization and validation, including configurable shadow effects. - Add
CanvasFields.textUnderlaysandCanvasFields.iconUnderlaysas aggregate field identities for editing authored text and icon source underlays. - Allow text and icons to use
CanvasFill.none()as their foreground while retaining their source silhouette for underlay rendering. - Breaking: remove
canvas_core_editor.dart; editor-owned history, picking, path hit testing, and snapping now live incanvas_editor_flutter. - Breaking: remove selection geometry and editor-only world interaction geometry from the core runtime API.
- Keep
canvas_corefocused on document/runtime semantics, document and render geometry, scene computation, serialization, and paint-plan construction.
0.10.0 #
- Breaking: replace the
NodeIdalias with the sharedElementIdidentity type. - Breaking: make
TextMeasurerandImageIntrinsicsinterface-only runtime contracts and remove image-intrinsic change notifications from core. - Breaking: rename
CoreServices.tmtotextMeasurerand remove the forwarding text-measurement extension. - Add
CanvasImageAssetResolverfor batch resolution of logical imagesourceRefvalues into host-renderable sources and stable intrinsic metadata. - Add
collectSceneFontFamiliesfor renderer/resource preflight across nested and hidden text and font-backed icon nodes. - Keep renderer-neutral scene preparation outside
CanvasRenderPipeline; the pipeline continues to own deterministic scene computation and paint-op construction only.
0.9.0 #
- Breaking: normalize image backing sources into the document-local
CanvasSceneDocument.assetsregistry. - Breaking: replace
ImageData.sourcePathwith nullableassetIdand makeImageData.sizea required editable frame size. - Add
CanvasImageAssetwith an opaquesourceRefand optional persisted intrinsic dimensions. - Validate image asset records and image-to-asset references.
0.8.2 #
- Add
encodeCanvasSceneanddecodeCanvasSceneas the canonical external JSON boundary forCanvasSceneDocumentvalues. - Keep scene decoding separate from semantic document validation.
0.8.1 #
- Add deterministic, domain-neutral
CanvasSceneDocumentvalidation with stable machine-readable issue codes and JSON Pointer paths. - Validate generic scene integrity including finite numeric values, established ranges, globally unique node IDs, neutral group-behavior envelopes, and recursively JSON-safe behavior data.
- Keep unknown group behavior types and versions valid so optional extension packages remain responsible for component semantics.
- Make the existing 80-character node-name limit Unicode-safe in both
validation and
NodeEditingXnormalization.
0.8.0 #
- Breaking: replace the exported
NodeMutationsextension withNodeEditingX. - Breaking: remove the public
withId()andwithChildren()node extension helpers. Structural identity and tree changes remain owned by scene-tree and rewrite operations. - Keep
withName(),withXf(),withHidden(), andwithLocked()as the public immutable node-editing convenience API.
0.7.0 #
- Breaking: require explicit
versionanddatavalues when constructing or deserializingGroupBehaviorRef. - Remove implicit version
1and empty-data defaults from behavior envelopes.
0.6.0 #
- Breaking: remove
SceneRenderBuilderanddefaultSceneRenderBuilder. Use aScenePreparerfor synchronous renderer-neutral scene transformation before callingCanvasRenderPipeline.build(), or callbuild()directly when no preparation is required. - Breaking: expose one stable
CanvasRenderPipeline.servicesbundle and removeCanvasRenderPipeline.createServices(). Preparation and final layout can now use the exact sameCoreServicesinstance. - Keep scene computation, paint-operation construction, content-bounds
calculation, and
RenderSnapshotcreation exclusively inCanvasRenderPipeline.build(). - Breaking: remove the unused
CanvasViewportPolicyandCanvasViewportSourceAPIs. UseCanvasViewportPlannerand select the bounds to fit explicitly. - Breaking: make
CanvasViewportPlanner.plan()returnCanvasViewportTransformdirectly and removeCanvasViewportPlanResult. - Breaking: remove
computeViewportWithPadding. UseCanvasViewportPlanner.plan()withpaddingPx, or callcomputeViewportdirectly for low-level viewport math.
0.5.0 #
- Breaking: remove
TextMeasureCacheand thetextMeasureCacheparameters fromCoreServices,SceneRenderBuilder,defaultSceneRenderBuilder,CanvasRenderPipeline.createServices(), andCanvasRenderPipeline.build(). - Breaking: remove the deprecated
CanvasRenderPipeline.buildCanonical()compatibility helper. - Delegate text measurement directly to the host-provided
TextMeasurer. Platform implementations are now responsible for their own caching strategy.
0.4.0 #
- Breaking: change
TextData.letterSpacingandTextMeasurer.measurefrominttodouble. - Replace synthetic hair-space expansion with native logical-unit letter spacing while preserving the original text.
- Add
letterSpacingtoDrawTextOp. - Remove
spacedText,measureSpaced, andmeasureSpacedText. - Existing non-zero spacing values now use the new native semantics.
0.3.0 #
- Breaking: remove the unused
labelnamed parameter fromHistory.reduce. - Breaking: remove the unused
labelnamed parameter fromHistory.withPresent. - History behavior and stored state are unchanged; labels were previously accepted but ignored.
0.2.2 #
- Add
CanvasFields.iconRefas the shared field identity for an icon's reference value.
0.2.1 #
- Add
CanvasFieldKey,CanvasFields, andCanvasFieldKeyConverteras a shared runtime field identity API.
0.2.0 #
- Breaking: replace the scene background color model with
CanvasFillviabackgroundFill. - Support no-fill, solid, and gradient canvas backgrounds.
- Add package licensing details for the public release.
0.1.1 #
- Fix internal layout imports to avoid resolving duplicate canvas_core types.
- Move image/icon layout payload types into a shared internal layout payload file.
0.1.0 #
- Initial open-source release of canvas_core.