feat(core): export flatten and outline stroke geometry from canvas (#826)

* feat(core): export flatten and outline stroke geometry from canvas

* docs(changelog): word the flatten geometry export like other entries

---------

Co-authored-by: mrhard9090 <moltrax88@gmail.com>
Co-authored-by: Danila Poyarkov <dev@dannote.net>
This commit is contained in:
MrHard 2026-10-04 14:13:08 +00:00 committed by GitHub
parent 8d10b9ca27
commit dc0922038b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 1 deletions

View file

@ -17,6 +17,7 @@
### Added
- Import `flattenNodesToVectorProps`, `outlineStrokeNodesToVectorProps`, and the `VectorFlattenProps` type from `@open-pencil/core/canvas` to compute Flatten and Outline stroke geometry in an embedding app without going through the editor's own write path.
- Check designs from the new Lint tab in the right panel: issues on the page, in the selection, or across the document are grouped by rule, hovering one highlights its layer on the canvas, clicking selects it and brings it into view, and one-click fixes bind colors to the variable they match and round subpixel geometry for a row or a whole group, and snap radius, spacing, and small text to the scale, convert groups to frames, and delete hidden layers one row at a time. Rules can be turned off individually or switched between the Recommended, Strict, and Accessibility presets.
- See which layer the code is about in the Code tab's Design JSX and Tailwind JSX: the element around the cursor marks its opening and closing tag and shows its layer on the canvas as a tinted box, apart from canvas hover, and design issues are underlined on the property that causes them, including while you edit Design JSX live.
- Fix lint issues outside the app: `openpencil lint --fix -o fixed.fig` binds colors to the variable they match and rounds subpixel geometry, and the `lint` and `lint_fix` tools let MCP clients and AI chat check a page and apply those fixes, plus radius, spacing, text size, group-to-frame, and hidden-layer suggestions on request. Lint messages carry each fix as data in `fix` and `suggestions`.

View file

@ -5,7 +5,7 @@ import { parseSVGPath } from '@open-pencil/scene-graph/parse-path'
import { makeBooleanSourcePath, makeStrokeOutlinePath, nodePathTransform } from './boolean'
import type { SkiaRenderer } from './renderer'
type VectorFlattenProps = Pick<
export type VectorFlattenProps = Pick<
SceneNode,
'name' | 'x' | 'y' | 'width' | 'height' | 'fills' | 'vectorNetwork'
>

View file

@ -4,6 +4,11 @@ export {
hasVisibleStrokeSourceNode,
nodeHasVisibleStroke
} from './boolean'
export {
flattenNodesToVectorProps,
outlineStrokeNodesToVectorProps,
type VectorFlattenProps
} from './flatten'
export {
distanceToGuideSegment,
getGuideScreenSegment,