Commit Graph
183 Commits
Author SHA1 Message Date
bflatastic 10789a2fb8 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/gaps.md
2026-11-27 16:05:40 +07:00
bflatastic a9dce94327 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/gaps.md
2026-11-27 16:05:17 +07:00
bflatastic ccd892cc8f Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/gaps.md
2026-11-27 16:04:47 +07:00
BFlat 2527ce5a81 Merge pull request #2650 from storytold/fix/2635-stroke-fringe
M8: a stroke's edges meet what is behind it and the fill, with no light fringe
2026-11-27 15:47:30 +07:00
bflatastic d654660c25 M8: a stroke's edges meet what is behind it and the fill, with no light fringe
An opaque inside stroke showed the fill through its anti-aliased outer edge, a thin light line on a dark background, and an outside stroke let the background show between it and the fill. Where the stroke hides what is under it, the fill now reaches the middle of the stroke (#2635).
2026-11-27 14:51:33 +07:00
bflatastic 41513f0838 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/gaps.md
2026-11-27 14:24:16 +07:00
bflatastic 2430b8036d Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/gaps.md
2026-11-27 14:23:54 +07:00
bflatastic 4ef95da6a5 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/gaps.md
2026-11-27 14:23:31 +07:00
bflatastic 0210633552 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/gaps.md
2026-11-27 14:23:04 +07:00
Livio Sidler 1de507c434 M8: moved points are told from float noise by ulps, not by a share of their coordinate
Review of #2592. A tolerance of a billionth of the coordinate is a hundredth of a unit at ten
million units: a visible move there could be taken for noise. 64 ulps is above what the box
following a point adds and under a pixel anywhere on the page.
2026-11-24 13:39:17 +01:00
Livio Sidler 810b8dc594 M8: a patch goes into the kept image row by row
A re-rendered area was cut out of its render into a pixmap of its own, and that drawn onto the
kept image: two more passes over the area, which for simple content took far longer than
rendering it. Its rows are now copied straight into place.

A 4.7 megapixel patch of two flat fills (a 4112 x 2292 view, release, one thread): 16.9 -> 2.8
ms a frame.
2026-11-24 12:50:52 +01:00
Livio Sidler 03e20611b1 M8: a moved point of a vector whose transform changed redraws all of it
Review of #2592. A vector's strokes are as wide on the page as its transform makes them: when
anything but where the layer lies changed in the transform, every stroke changed, whether its
path moved or not, so the vector is drawn again whole. Points count as moved past float noise
relative to their coordinates (1e-9), not past a fixed ten-thousandth of a unit; and a stroke's
reach on the page goes by the most the transform stretches a length, which under a skew is
more than either axis is stretched.
2026-11-24 12:40:34 +01:00
Livio Sidler 15a8c15bcd M8: an outline shadow's spread reaches as far as its layer is stretched, and one shows across the widest view
Review of #2590. The area a spread shadow shows in was sized by the transform's area scale: a
layer stretched one way and squeezed the other spreads further that way than that. It now goes
by the most the transform stretches a length. And the pixmap a shadow is blurred in may be a
blur's reach wider than the widest pixmap: across a 16,384 pixel view it was refused, and the
shadow left out.
2026-11-24 12:37:03 +01:00
Livio Sidler 11da741c49 M8: a clipping frame that takes in the whole pixmap costs no layer, mask or copy there
Close up, the view (or the band or patch of it being drawn) lies inside its clipping frames.
Each still copied the pixmap, filled a mask for it and put the copy back through the mask,
pixel by pixel: a frame with an edge off screen on a fraction of a pixel never took the
whole-pixel path. Now a clip that takes in the whole pixmap draws its children as they are;
edges at or past the pixmap's count as whole; and rows of a mask that are all in or all out are
copied or kept in one piece.

A view inside four nested clipping frames at 1,933% on a 2x display (4112 x 2292, release, one
thread): 119 -> 87 ms, a band of it 18 -> 12 ms.
2026-11-24 12:31:10 +01:00
Livio Sidler 0a4f57edce M8: a moved point redraws its vector around it only
A point dragged in the vector editor changed the vector, so its whole box was drawn again.
Zoomed to the vector (as the editor does) that is most of the view, past the share a patch may
cover: every frame of the drag was a full render, drawn in bands over several frames. A
vector that differs only in where its points and handles are now redraws the segments that
moved and their neighbours (joins and rounded corners follow them), as far out as its stroke
reaches. Dashes, width profiles, brushes, gradients and images, effects, masks and open filled
paths depend on the whole outline: those are drawn again whole, as before.
2026-11-24 12:21:25 +01:00
Livio Sidler e34724047d M8: a drop shadow of an opaque shape is drawn where it shows, at the resolution its blur needs
A layer with a drop shadow was drawn with the shadow's reach around the pixmap (1,392 pixels
each way for a 16 px blur at 1,933% on a 2x display) and the shadow blurred from a copy of
all of it, once for every band of a full render. A shape or frame with opaque paints now
casts its shadows from its outline: only over the pixels that show, and a blur of 8 device
pixels or more is drawn smaller, blurred and scaled back up, on a grid that follows the shape so
bands, patches and whole views agree. A frame that doesn't clip (a stack) counts while
everything its children paint stays inside its box; its shadows that spread still come from
its pixels, as they did.

zoomed_card_timings (release, one thread, 4112 x 2292): the view in 8 bands 4576 -> 152 ms,
the slowest band 598 -> 21 ms.
2026-11-24 12:05:40 +01:00
Denis Gomes 81eb01e821 M8: a layer exports at the size of what it draws, strokes as drawn
SVG, PNG, PDF and Vector Drawable exports took their size from the
renderer's bounds, and Node::outline_reach grows a line's, vector's or
polygon's box by the weight times the miter limit (up to 4) to leave room
for a mitre at any corner. An icon frame whose outlined strokes stay
inside it exported at 26 x 26 to 30.8 x 24 instead of 24 x 24, its content
moved off the frame's origin.

export_bounds now walks the tree as world_render_bounds does
(Document::world_render_bounds_with) and measures each layer's own paint
on the outlines it draws: its shape and its stroke area from stroke_fill,
in page space, grown by its effects. A dashed stroke counts as a solid one
as well as its dashes, so where the dashes fall doesn't change the size.
Text and drop shadows with a spread keep the renderer's bounds. The
renderer's own bounds, used for drawing and culling, are unchanged.

Shrinking outline_reach itself was rejected: the renderer culls and
caches by it, and an exact stroke there would cost a stroke outline per
layer per bounds query.
2026-11-24 02:32:28 -05:00
Dylan M. Taylor 8320b6699e render,format: finish craft-image-codecs cutover and ICC/GIF/bounds parity tests (#2526) 2026-11-20 13:02:48 -05:00
f7acb637f0 M6: restore full JPEG export chroma (#2521)
* M6: restore full JPEG export chroma

* M6: check the JPEG matte away from the painted edge

* docs: keep the parity header's change level and describe the JPG chroma fix

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: FredApps <FredApps@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 21:28:36 +07:00
Dylan M. Taylor 48ebd1b58b fix(render): clamp non-finite samples in thumbnail_f32 (#2525) 2026-11-20 08:06:16 -05:00
Dylan M. Taylor d4d4b5760a render: preserve float thumbnail precision and verify output/ICC parity (#2518)
* render: preserve float thumbnail precision and add output/ICC parity tests

* test: match integer un-premultiplication in export_output_and_icc_parity
2026-11-19 23:55:48 -05:00
FredApps e97b644a39 Merge pull request #2515 from Terra854/fix/u16-thumbnail-precision
Preserve 16-bit precision when scaling thumbnails
2026-11-20 08:49:24 +07:00
Terra854 11bfa4db58 M8: preserve 16-bit thumbnail precision 2026-11-20 07:27:16 +08:00
Terra854 3120523acc M8: preserve stored raster orientation 2026-11-20 06:53:33 +08:00
Dylan M. Taylor 4e35fb9cea render: use shared raster decoding and export (#2501)
* render: use shared raster decoding and export

* render: fix Cow<Image> ownership and run cargo fmt
2026-11-19 14:00:49 -05:00
FredApps e2aa302165 Merge remote-tracking branch 'origin/main' into fix/present-hidpi-detail-2127
Signed-off-by: FredApps <153173854+FredApps@users.noreply.github.com>

# Conflicts:
#	docs/prototyping-parity.md
#	docs/target-app-parity.md
2026-11-18 16:41:47 +07:00
bflatastic 3451d42118 M8: a test that a textured layer renders the same in column and row bands 2026-11-17 17:43:41 +07:00
bflatastic 3c92930224 M8: the strips a pan uncovers render in parallel bands, as full renders do 2026-11-17 17:14:57 +07:00
Trevor BrownandClaude Sonnet 5.5 d851ac07f0 Merge upstream main into fix/present-hidpi-detail-2127
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium
2026-11-12 19:39:16 -05:00
bflatastic 6bbd92856c Merge main into #2224 2026-11-12 11:24:51 +07:00
BFlat db63355da8 Merge pull request #2232 from denisg0mes/zoomed-out-image-copies
M8: zoomed-out images draw from small copies that stay decoded
2026-11-12 11:14:10 +07:00
bflatastic 0c5bbc07a7 Merge main into #2224 2026-11-12 11:03:16 +07:00
bflatastic cf28715c18 Merge main into #2221 2026-11-12 10:47:13 +07:00
bflatastic a46e696e71 Merge main into #2133 2026-11-12 10:27:25 +07:00
bflatastic a905f50211 Merge main into #2224 2026-11-12 10:11:23 +07:00
bflatastic e0bc1e8951 Merge main into #2232 2026-11-12 10:10:45 +07:00
BFlat fdb5ef4aa0 Merge pull request #2081 from TrevorBrown-dev/fix/ellipse-four-anchors-2080
Ellipse: an unsliced ellipse edits as four anchor points, not six (#2080)
2026-11-12 09:55:56 +07:00
bflatastic 058492a693 Merge main into #2133 2026-11-12 09:43:12 +07:00
bflatastic b1ee6535c9 Ellipse tests: drop an unused binding and a comment about an allowance main never had 2026-11-12 09:23:03 +07:00
Trevor BrownandClaude Opus 5.5 4641f9deeb Merge upstream/main into fix/boolean-corner-radius-2222
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 17:49:04 -05:00
Dylan M. Taylor 81371f4a53 render: seed and mix the node-id cache hash, skip the cell allocation past the pattern limit (#2254)
* render: seed and mix the node-id cache hash, skip the cell allocation past the pattern limit

* render: use hash_one in the bucket test
2026-11-11 14:49:35 -05:00
Trevor BrownandClaude Sonnet 5.5 529134b850 M4: a boolean group's corner radius rounds its result (#2222)
A boolean group takes a corner radius (and corner smoothing): the Design panel shows the field for it, `node.set cornerRadius` writes it, and the renderer rounds every sharp corner of the group's result after the fold, convex and concave alike. Layers inside keep their own radius and do not stack with it, a radius larger than the edges allow shrinks to fit while the field keeps the typed value, Flatten bakes the arcs, and a mixed selection reads Mixed. Measured in Figma's web app on 2026-11-10.

The rounded result is cached apart from the fold (keyed by the folded path, radius and smoothing), so scrubbing the radius never redoes the boolean steps. The .fig and REST importers and the .fig exporter now carry the radius and smoothing of a boolean group, and paste properties and radius variables reach it. Docs: ui-parity, target-app-parity, gaps, file-format-parity, ROADMAP, mcp.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Fable 5.1 designed; Sonnet 5.5 wrote at medium
2026-11-10 13:36:10 -05:00
Trevor BrownandClaude Sonnet 5.5 020388cf1f M10: Export: a background blur or glass exported on its own keeps the content behind it (#2213)
An export of a layer draws only that layer, so a background blur or glass in it read an empty
backdrop. The export now renders the page's layers below the first exported layer, with the margin
the effects reach, as the backdrop (render_area_over), clipped to the export area; only the exported
layers are drawn on top. Layers without those effects, and every other export path, are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium
2026-11-10 10:31:10 -05:00
Denis GomesandClaude Opus 5.5 c82986b26c M8: zoomed-out images draw from small copies that stay decoded
The canvas drew an image shown smaller than its pixels from a 4096 or 8192 px
copy, and an image of 4096 px or less from itself, whatever its size on screen.
A page of a few hundred photos zoomed out then asks the decoded-image cache
(512 MB) for several GB: every render decoded them again, and a zoom out took
seconds with the canvas empty around the old frame.

The copies now also come at 256, 512, 1024 and 2048 px, the smallest that holds
the size shown. Measured on a file with 237 images (median 5.8 MP), canvas
options, 2352 x 2090 view, M4 Max:

| zoom | before | after, first | after, again |
|---|---|---|---|
| 10% | 0.25 s | 0.12 s | 6 ms |
| 4%  | 0.88 s | 0.46 s | 7 ms |
| 1%  | 3.4 s  | 0.9 s  | 4 ms |

Peak memory over the run went from 3.9 GB to 2.3 GB. Exports and views at
100% and closer still draw from the image itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 02:39:52 -05:00
Trevor BrownandClaude Sonnet 5.5 bceb0bb233 M5: present a tall frame sharp on HiDPI displays with a device-scale detail texture over the capped frame (#2127)
Cause:
- The presenter rasterises a whole frame once, capped at 16.8 MP (texture_scale), so a 1440 x 9701 frame is drawn at 1.0959 px per unit (1579 x 10632 px).
- On a 2x display at Fit width or 100% the GPU stretches that 1.8x with linear filtering; scrolling only pans, so the same texture is reused.

Fix:
- render: render_area_at(doc, ids, b, scale, time), the GIF-clock form of render_area.
- present/actions.rs: texture_scale split into pure texture_scale_for plus the ctx wrapper; pure detail_plan (the view plus a quarter margin each way, inside the frame, shrunk to the side and pixel caps; None when the whole texture is already at device scale); Presenter::detail_texture caches one detail for the current frame and renders it with render_area_at.
- present/draw.rs: paints the detail right after the base texture, so overlays still paint over it; it is re-rendered when it stops covering the view, and not while a fling, drag or the wheel moves the view (the capped texture shows then).

Verified:
- tall_frame_detail_plan_renders_the_view_at_device_scale: compile error on main (neither function existed).
- presenting_a_tall_frame_on_a_hidpi_display_draws_the_view_at_device_scale: failed on main at the size[0] >= 2878 assert (only present texture 1579 x 10632).
- present tests 99 passed; figcraft-ui-egui --lib 1107 passed; figcraft-render --lib 245 passed; clippy -D warnings, fmt and cargo xtask wasm clean.

Not changed:
- Transitions, smart animate, overlays, the bar thumbnail and the pane keep the capped whole-frame texture; MAX_TEXTURE_PIXELS is unchanged; no tiling.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Fable 5.1 briefed; Sonnet 5.5 wrote at medium
2026-11-08 19:56:53 -05:00
Trevor BrownandClaude Opus 5.5 0c1fb11c48 Render band test: the comments say what row_stats divides by and what the artifact case measures (#2080)
row_stats sums the differences of the pixels above noise and divides by the whole row's channel count; the doc now says so. The artifact case changes only the colour channels, so its mean is 2.25, which the earlier allowance let through, and its comment now says it fails on the mean while its count stays within a twentieth of the row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove and wrote at high; no brief
2026-11-07 19:37:16 -05:00
Trevor BrownandClaude Fable 5.1 0774e44fa8 Render band test: only small antialiasing differences are forgiven, a real band artifact still fails (#2080)
Pixels whose largest channel differs by 24 or less are noise and left out of the row mean, which keeps its original 0.25 limit; the differing-pixel limit is unchanged. A unit test shows a 44-pixel row off by 60 still fails.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-07 13:41:25 -05:00
Trevor BrownandClaude Fable 5.1 4118be890c Ellipse: the four-cubic contour is closed, and the band test allows apex antialiasing (#2080)
The band test compared row 10, the ellipse top, where the cubic now ends exactly at its level extreme; 8 pixels antialias slightly differently between a short band and the whole view. The row mean limit now grows by 0.05 per such pixel; whole-row artifacts still fail.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-07 12:42:44 -05:00
BFlat f569ff683e Merge pull request #1849 from samhyun/fix/stroke-corner-reach
M8: a stroke's square dash ends and brush shapes paint within its bounds
2026-11-07 12:21:35 +08:00
BFlat 4811d2efce Merge pull request #1795 from samhyun/fix/partial-texture
M8: grains stay in their cells whatever origin a render starts from
2026-11-07 12:16:31 +08:00