A dropped or placed .avif was refused as an unsupported image. craft-image-codecs' avif-decode
feature (craft-video's pure-Rust AV1 decoder) is turned on in format and render, the file pickers
and open lists take .avif, and an AVIF's container rotation, mirror and crop apply as for HEIF.
The browser build refuses AVIF with the desktop-app message.
A frame painted its strokes over its children whether it clipped them or
not, so a child laid across its edge (an outlined text field's floating
label) had the border cut through it. A frame that doesn't clip its
content now strokes before its children, on the canvas and in the SVG,
PDF and Vector Drawable exports; a clipping frame still strokes over
them.
* M4: gradient handles on a straight line show where their stops paint (#2967)
* M4: a snapped pen click that wobbles pulls out no handle (#2967)
* M4: paste into another frame keeps the place the layers had in theirs (#2967)
* M4: Paste to replace takes SVG another app put on the clipboard (#2967)
* docs: parity log for #2967
* fix(render): touching rectangles leave no hairline where they meet (#544)
* fix(render): snap a box side only where neighbours meet its whole length (#544)
A side moved when any part of it touched a sibling, so a long box beside
a short one lost the exact coverage of the part touching nothing. Edges
that differed by under 1/4096 unit also counted as shared, closing
sub-pixel gaps at high zoom.
Now a side snaps only when sibling sides within a sixteenth of a device
pixel cover its whole length. Sides that match round to the nearest
pixel alike; a short side against a longer one rounds outward over it
and the longer one stays exact.
* fix(render): round a short side outward only over opaque boxes (#544)
A short side meeting part of a longer one rounds outward over it, so
the shared pixel strip is drawn by both boxes. With a translucent fill
or node opacity that strip showed darker. It now rounds outward only
when the box and every neighbour on that line are opaque and normally
blended; otherwise that side keeps its exact edge.
* fix(render): sides that meet round from one shared line (#544)
Sides within the tolerance of each other counted as shared but each
rounded its own position, so a pair straddling a half pixel landed on
different whole pixels and left a one-pixel gap. Matching sides now all
round the same line, the lowest of their positions.
* fix(render): tiny layers in the zoomed-out preview snap shared sides too (#544)
Rectangles under two device pixels skip splat_fills and go straight to
splat_subtree, so a block of them still showed a lighter seam far
zoomed out. splat_subtree now fills the snapped box as well, except
under a translucent parent, whose opacity it applies to each layer on
its own.
* fix(render): leave layers the editor draws itself out of shared edges (#544)
A sibling in the render's skip list isn't drawn, so a box beside it
kept its exact edge rather than snapping to meet it.
The decoded-image cache held 256 copies whatever their size, fewer than one
page of such a file shows, so a render dropped copies it needed again. Image
adjustments ran per pixel at full size after every decode, and a copy at a new
size, or a shadow's opacity check, decoded the image again.
- The cache holds up to 4096 copies within its unchanged 512 MB budget.
- Adjustments are looked up in a table of the colours an image has met (the
same results).
- A canvas copy at a smaller size is averaged down from a larger cached copy;
exports reuse only the full decode, so their pixels are unchanged.
- An image's opacity is remembered with its full size after one look.
Tests: image_reuse_tests; timings: real_file_bench_tests (FIGCRAFT_BENCH_FILE).
A frame, component, component set or instance with Clip content off now draws its
drop shadows as its outline is, only moved by their offset: no ring for a positive
spread, no shrinking for a negative one. A rectangle or a clipping frame still grows
and shrinks them, and turning Clip content back on brings the spread back (the
stored value is unchanged).
The canvas, PNG/JPG/WebP, PDF and SVG exports agree, and the paint and export
bounds leave no room for the ignored spread. Inner shadows keep their spread.
- ImageData equality: two lazy images that both fail to load no longer compare equal; equal
content-hash keys compare without reading either store (as the PR describes).
- save_to and encode_at share FileSnapshot::prepared instead of duplicating the doc prep.
- render: video players read lazy bytes through ImageData::bytes (new on main since the PR).
- docs/file-format-parity.md: revision row for #1313.
Resolves conflicts in crates/engine/src/lib.rs (keep both test modules) and
crates/penpot/src/export.rs (keep main's orientation check on lazily loaded bytes).
Once the drag ends, the sprite keeps asking for and showing a backdrop render of its last
place until the canvas render replaces it, so a render still on its way when the button goes
up isn't left showing an older place's backdrop. A render test checks that a layer dragged
together with the pane, under it, shows through the pane as it would where both are.
A dragged layer with any effect on it used to give up the drag sprite, so every pointer
move asked the canvas for a new render (about 20 ms each for a 600 x 360 glass pane over
stripes in a debug build here; 48 ms per move in the release glass bench at 200 %), and the
layer stuttered behind the pointer.
- The sprite now takes layers with effects of their own (drop and inner shadows, blurs,
noise, texture, glass): render_area draws them as the page does.
- A background blur or glass in the sprite reads what lies under it where the layer is now:
figcraft_render::render_area_moved draws the layers where they started but reads their
backdrop at the drag's shift. A thread of the sprite's own renders it for the latest shift
and hands the image back; the sprite keeps moving with the outline every frame and shows
the newest render. The canvas renders nothing until the drop.
- The glass shading loop runs its rows in parallel outside a parallel render (exports and
the sprite), as blurs already do; bands of a canvas render stay on their own thread.
On a dark interface the canvas draws white sections, the section colour presets and the default
section border in dark tones instead of bright light blocks, and the Section color swatches show
those tones. A custom colour draws as it is. The stored colour stays, so the light theme, exports,
thumbnails and the file are unchanged; switching the theme redraws the canvas.
A video is kept as an image fill's source, the file itself, like an
animated GIF: place it, import it, drop it on the canvas or pick it in the
fill picker, on any layer that takes an image fill. The canvas,
thumbnails and exports show its first frame; the presenter and the
preview play it muted and looping, one frame decoded at a time on the
GIF clock. H.264 video in MP4 and MOV, read and decoded in pure Rust by
craft-libs' craft-media and craft-video (no new third-party crates).
The heif codec feature moves from the workspace line to the desktop-only
entries of figcraft-format and figcraft-render (#2770), craft-heif is only
probed on desktop, and the browser refuses a HEIF with the same "desktop app"
message as TIFF. Fixes the wasm build.
Exposure multiplied the encoded channels by 2^(2e), so +0.42 left a
photo some 20 levels too dark and -1 crushed it. It now runs each
cube-rooted OKLab cone response through a soft limit at a gain of
2^(2e): the darks brighten most, white stays white, and brightened
colours fade towards white, as renders of grey and colour ramps show.
The colour crate exposes the cone conversion it already had.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012eBDgsvRwsSRpWeWrzabVY
Only a layer in a blend mode of its own (Normal included) groups its
blended drop shadows; a pass-through frame's burn into what lies under
it, as the reference tool draws the glass buttons' dark ring.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012eBDgsvRwsSRpWeWrzabVY
Figma takes HEIC images; FigCraft refused them, its docs waiting for a Rust
decoder. craft-libs has one now: craft-image-codecs' `heif` feature, which
craft-heif backs with heic-rs (pure Rust, no `unsafe`, MIT OR Apache-2.0).
This turns it on, so Place image, a drop on the canvas, File > Open and an
image fill's replace take iPhone and Mac photos. The file is kept as is.
A HEIF records its rotation, mirror and crop in the container (irot, imir,
clap); they are part of the picture and its EXIF only mirrors them. FigCraft
draws other formats' stored pixels whatever their EXIF says, so
`figcraft_format::keeps_stored_orientation` answers per file, and the
renderer's decode, the file thumbnails, the Penpot export and the size a
layer gets all go by it: the layer's size and the pixels drawn in it agree.
The size comes from craft-heif's probe of the container, without decoding.
Tests: heic_import_tests: a 64 x 32 photo stored a quarter turned comes in
32 x 64, black above and white below, from Place and from File > Open.
With #2533 a layer's drop shadows are collected and, when one blends by a mode of its own,
drawn into a group first. shadows_hidden now filters what is collected, and shadows_only
is false for a shadow with another blend mode, so such a layer takes the path that groups.
clip_covers and in_box tested such a corner as the arc of a round one, which cuts off
less: a clipping frame's children showed in the corner the chamfer cuts off.
From the review of #2735:
- shadows_hidden asks clip_covers, which takes a corner for an arc: a chamfered or concave
corner cuts off more, and a shadow that shows there was left out.
- Zoomed out with levels of detail, and with a backdrop effect, draw_layer casts a shadow
from the layer's pixels although the layer has an outline to cast from. What an edit
redraws now asks the same question draw_layer does (draw::outline_cast).
From the review of #2732:
- A segment is on the outline when the fill lies on one side of it, in the fill or outside it
when on both or neither. The loops alone don't say: a loop inside another that turns the
same way bounds nothing under the non-zero rule, and was stroked as outline.
- An inside stroke cut every line in the fill by the fill. Now only what shows past the
outline around a point where such a line ends on it: a line that goes through the fill
keeps its parts outside, and one close to the edge its whole stroke.
- A segment's middle comes from its own curve, not from a copy of the network.
- The stroke cache's key takes in the segments and the points' places: the loops name
segments by number, and two networks can have the same path with other numbers.