Commit Graph
191 Commits
Author SHA1 Message Date
BFlat f184f85a33 Merge pull request #2673 from storytold/fix/2664-image-downscale
M8: a downscaled image is filtered, so fine detail doesn't turn into moiré
2026-11-28 16:20:26 +07:00
bflatastic e9a5986e69 M8: a downscaled image is filtered, so fine detail doesn't turn into moiré
An image fill shown at half its pixels or fewer (a 0.5x export, the canvas zoomed out) was sampled straight at that size with bicubic filtering and nothing averaging the pixels between samples, so fine detail aliased into moiré bands. It now draws from a copy averaged down to under twice the size it shows at (the image halved, or the canvas's smaller copy halved), cached like the canvas's copies. Every copy averages the finished pixels (premultiplied, after the image's adjustments) and is placed where the image itself would be; the size shown is measured on the axis showing the most device pixels, so an image squeezed on one axis by its crop or its layer keeps the other's pixels. Images shown larger draw as before.

Fixes #2664.
2026-11-28 15:41:42 +07:00
Bryton Cooper d9deec7b12 perf(doc): share TextData and VectorNetwork copy-on-write via Shared<T> (#1819) 2026-11-28 01:27:27 -07:00
FredApps 3e44fd805a Merge branch 'main' into perf/partial-upload 2026-11-28 07:38:30 +01:00
bflatastic 7a5a7b772c M8: a drop shadow of an outside-stroked layer is one solid silhouette
A sharp drop shadow under a stroked layer (text with an outside stroke most visibly) showed a light outline along the layer's edge wherever that edge lay over the shadow. Hiding the shadow behind the layer cut the layer's share of each anti-aliased edge pixel out of the shadow, then the layer's edge pixel drew that share again: the edge counted twice. The shadow now keeps its part outside the layer scaled by what the layer lets through there, the outlines it is cast from and hidden behind follow what the layer fills (#2635), and stroked text casts and hides its shadows by its outlines too (#2631).
2026-11-27 16:49:58 +07:00
Livio SidlerandClaude Fable 5.2 efed22afd9 Merge main: the gaps list after the other M8 changes landed
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-27 10:11:49 +01:00
Livio SidlerandClaude Fable 5.2 5c1f4c5462 Merge main: patches go on the image kept for the eyedropper, and a drag's base render says what it skips
main's canvas keeps the texture's pixels (the eyedropper reads them) and its
worker marks an image that leaves layers out. A render handed over as patches
puts them on that kept copy as on the texture, and carries the mark.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-27 10:08:34 +01:00
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 3cbc4d0031 M8: the browser's canvas uploads only what an edit changed of its image
Every finished render was converted to a texture image and uploaded whole: after an edit that
redrew a part of the view, all of the view and its margin again, every frame of a drag. The
retained renderer now says where a patched image differs from the one before (nothing after a
full render or a pan, which moves every pixel), the browser's worker numbers its images and is
told which one the canvas's texture holds, and a render that only patches that image hands over
the patches, which go onto the texture in place. The image around the view and the desktop's
render thread hand over whole images, as before.
2026-11-24 13:02:00 +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