openpencil/tests/engine
Danila Poyarkov d2e380ea9d
fix(core): draw gradient and image strokes as the paint they are (#868)
* fix(core): draw gradient and image strokes as the paint they are

A stroke carried the paint vocabulary already, but nothing read it: the
.fig reader sent every stroke paint through resolvedPaintColor, which
returns black for a gradient or image, the renderer set a flat color on
strokePaint, and the writer emitted a SOLID paint.

Strokes now go through the same conversion fills do in both directions,
and applyGradientFill and applyImageFill take the target Paint so a
stroke reuses the fill shader path instead of growing a second one.
forVisibleStrokes is the single place every stroke draw passes through,
so the shader is set and cleared there rather than threaded through each
draw helper.

Closes #797 for rendering and .fig; authoring a gradient stroke from the
stroke panel is still to come.

* feat(app): author gradient and image strokes from the stroke panel

StrokeSection opened a solid-only colour picker and synthesised a fake
fill for the swatch, so a stroke could never be anything but one flat
colour. It now opens FillPicker like the fill panel does, and
applyStrokePaint keeps the stroke's weight, align, cap, join and dashes
across a paint change.

Completes #797.

* fix(core): let a gradient stroke reach vector outlines and arrowheads

A vector stroke draws its outline as a filled shape with fillPaint, a
dashed one strokes the path, and arrowheads are filled shapes of their
own; each cleared the shader first, so a gradient or image stroke on a
vector drew black. The stroke pass now configures both paints and owns
clearing them, and those helpers keep what it set.

Resolve each gradient stop against the stroke's own colour binding
rather than the stop's position, which looked up another stroke's.

Reported in review of #868.

* fix(core): release the shaders a paint no longer owns

Every gradient and image shader was handed to a paint and then leaked:
the paint takes its own reference, so the caller's handle has to go or
WASM memory grows with each redraw. Only the diamond branch did this.

A gradient stroke now configures two paints, which doubled the leak.

Reported in review of #868.

* test(render): model a shader handle the caller deletes

The pattern shader double returned a plain string, so deleting the
handle the paint no longer owns threw instead of passing.
2026-10-04 13:25:45 +00:00
..
acp
app build: update dependencies (#873) 2026-10-04 12:48:24 +00:00
cli feat(fig): occurrence-scoped instance interpretation as the single .fig reader 2026-10-01 11:20:27 +04:00
clipboard fix(fig): read, render, and write Figma slots (#850) 2026-10-04 00:45:10 +04:00
collab Release v0.15.0 2026-09-16 17:57:35 +03:00
color feat(scene-graph)!: make a stroke a paint (#864) 2026-10-04 13:38:05 +04:00
core feat(fig): occurrence-scoped instance interpretation as the single .fig reader 2026-10-01 11:20:27 +04:00
dom-css fix(fig): restore strict parse validation 2026-07-18 03:58:18 +03:00
figma/api feat(lint): suggest group-to-frame and hidden-layer fixes; keep canvas edits in code previews (#870) 2026-10-04 12:46:06 +00:00
geometry feat(scene-graph)!: make a stroke a paint (#864) 2026-10-04 13:38:05 +04:00
hit-test perf(scene-graph): accelerate axis-aligned hit tests (#534) 2026-08-16 15:43:25 +03:00
icons fix(core): preserve inline SVG primitives (#485) 2026-08-12 16:02:45 +03:00
io fix(core): fill open subpaths of filled SVG paths (#876) 2026-10-04 13:25:23 +00:00
kiwi feat(fig): occurrence-scoped instance interpretation as the single .fig reader 2026-10-01 11:20:27 +04:00
layout feat(scene-graph)!: make a stroke a paint (#864) 2026-10-04 13:38:05 +04:00
library build: upgrade oxfmt and format Vue imports (#669) 2026-09-10 02:45:13 +03:00
lint feat: check designs live with a Lint panel, canvas markers, and fixes (#804) 2026-10-04 10:08:39 +00:00
mcp fix(MCP): add read-only file lifecycle tools (#722) 2026-09-18 11:55:06 +03:00
pen feat: export components as Storybook stories (#751) 2026-09-30 03:16:47 +04:00
profiler
random
render fix(core): draw gradient and image strokes as the paint they are (#868) 2026-10-04 13:25:45 +00:00
snap
tauri fix(fonts): explain PingFang substitution and draw its CJK text (#781) 2026-09-26 11:14:30 +04:00
text fix(text): render variable font styles at their named instances (#773) 2026-09-26 11:25:01 +04:00
tools feat(scene-graph)!: make a stroke a paint (#864) 2026-10-04 13:38:05 +04:00
vector feat(canvas): render arrow stroke caps on lines and open vectors 2026-08-31 21:25:38 +03:00
vue feat(scene-graph)!: make a stroke a paint (#864) 2026-10-04 13:38:05 +04:00
perf.bench.ts