Commit Graph
5193 Commits
Author SHA1 Message Date
Denis Gomes 17e86e8aea M7: a file dropped quickly from Finder lands in view, not at 0, 0
On macOS the window gets no pointer events while a file is dragged in
from another app. Released at once, the drop came with no pointer
position, and the image went to the page's 0, 0, usually far out of
view, so the drop looked like it did nothing. Held over the window for
a moment, macOS raised it, the pointer became known and the image
landed under it.

With no position, a dropped file now lands in the middle of the view,
where File > Import puts it.
2026-11-24 21:28:24 -05:00
Dylan M. Taylor ef2a9eeefc packaging(linux): support co-installable nightly packages (#2603)
Linux nightly packaging by @dylanmtaylor, with the per-app Nightly flavor commits stacked on his branch.

Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
2026-11-24 18:55:17 -06:00
Denis Gomes 20de68e9ca Tests: the reopen and file view tests remove their folders when they fail too
The folders were removed at each test's end only, so a failing assertion
left them in the temporary directory. They are now removed on drop, as
path_read_caps_tests does.
2026-11-24 18:59:18 -05:00
Denis Gomes 09553289ba Desktop: load the preferences before opening the files named on the command line
The files named on the command line opened before the preferences were
read, so file.open saw no kept views: such a file opened fitted instead
of where it was left. It also put the file at the top of the recent
files, and the preferences read just after replaced that list.
2026-11-24 18:59:18 -05:00
Denis Gomes 16976d07c3 A text layer's name counts as unique only over all of a variant's text layers
The name fallback counted names after path matching had taken its layers,
so with a/Label and b/Label switching to a/Label and c/Label, a/Label
matched by path and the two leftovers looked unique: text typed into
b/Label landed in c/Label, although Label names two layers on each side.
Names are now counted over every text layer outside nested instances,
matched ones too, and only then limited to the unmatched ones, as the
rule says: exactly one layer of that name on each side.
2026-11-24 18:52:46 -05:00
Denis Gomes a69319e8bd Frames resized together or dropped into a frame land on whole pixels too
Resizing several frames at once rounded only the pointer, and each frame
took its share of the scale as is: two 100 wide frames resized from 300
to 400 became 133.33 wide, one at 266.67. Each one now has its edges on
the nearest whole pixel of its parent, so the box still follows the
drag, at most half a pixel off per edge, and is never less than a pixel.

A frame moved into another frame was settled on whole pixels of the
parent it was dragged in, then reparented on the drop with its place on
the page kept, so in a frame off the grid it sat at .5 in it. It is
settled again in the frame it is dropped into.
2026-11-24 18:46:30 -05:00
Denis Gomes e8057eeaef A main the library holds only for an offered component pastes as a copy
published_main took any main the library's manifest lists as published.
The manifest also lists the components offered ones use, hidden from
publishing included, with published false, so such a hidden main pasted
into another file became an instance of the library's copy. It now has
to be offered itself, and otherwise pastes as a copy of itself, as a
hidden component the library doesn't hold already did. Instances pasted
from the library file still take such a main from the library, since an
offered component brings it along.
2026-11-24 18:42:45 -05:00
Denis Gomes 35ca50280f Paste properties into another file pastes no links
Whether a copied style or variable was there to link to was decided by
its id, and ids are numbered per file: the first style of every file is
S:1. Pasted into another file that had styles or variables of its own,
the copy linked to whichever of them shared the copied id and took its
values instead of the copied ones. The test passed only because its
second file had none.

Copy properties now records the file it copied from, and a paste into
another file drops every style and variable link: the values paste
unlinked and the layer's own links on them go. The id check stays for
a style deleted since the copy.
2026-11-24 18:37:06 -05:00
Denis Gomes 58b24d7faa Paste properties keeps bindings on what the copy doesn't carry
The pasted layer's bindings gave way on every property it could take,
not only on those the copy carries: frame properties pasted onto a text
layer removed its font size variable while leaving the font size, and a
copy without corners did the same to a bound radius. A binding now
gives way only where the copy sets that property.

Layout grid bindings are keyed `layoutGrids/…`, not `grids/…`, so a
frame's grid bindings also went to layers that take no grids.
2026-11-24 18:31:17 -05:00
Denis Gomes 39405b02a6 The pixel grid test checks that its lines sit on the screen's pixels
The test checked only the lines' width, so it still passed with the
lines placed between two screen pixels, where a one-pixel line spreads
over both at half strength and no longer reads as measured. It now pans
the view off whole points and checks every line's position at 1x and 2x.
2026-11-24 18:30:36 -05:00
Denis Gomes b237794c2e Paste properties unlinks a layer whose copied style is missing
A copied style link the file no longer has was dropped from the paste,
so the pasted layer kept its own style link. When the pasted values
differ, the list sync unlinks it after the command anyway; when they
match, the layer stayed linked to a style the copied layer never had.
The missing link now pastes as null, the same as a copied layer with
no style.
2026-11-24 18:29:04 -05:00
Denis Gomes 0ada8463ab Paste over selection: absolutely positioned layers aren't in the flow
Several absolutely positioned children of one auto layout frame took the
flow branch, so the copies went to the last one's top-left, over it. The
layout doesn't place them, so they now take the geometric branch like
layers elsewhere: below the lowest, at the selection's own gap.
2026-11-24 18:27:34 -05:00
Denis Gomes e0ca0604ae A scrolling panel menu stays open on a scroll bar click and keeps its rows' ids
A click on a scrolling menu's scroll bar track scrolled it and then closed
it: the menus close on any click, and egui counts the bar's click as one,
so a row the click brought into view could not be picked. The menu now
ignores clicks for the frame its scroll bar is clicked; row clicks and
clicks outside still close it.

The rows were also laid out in the scroll area's own UIs only while the
menu scrolled, so their ids changed when a resized window started or
stopped the scrolling, and the row the keyboard was on lost it. Both
ways now lay the rows out in one UI with a scope id from the popup's.
2026-11-24 18:24:26 -05:00
HagaiBA 56e5e9ed6f i18n(he): refine disconnected warning, ?key=… BiDi isolation, and select.same* labels 2026-11-25 00:25:12 +02:00
HagaiBA 2cafd22260 i18n(he): strip BiDi marks, place {n} before noun in plurals, and use action nouns in he.toml 2026-11-24 23:42:15 +02:00
aiongg 77a4c9480a Repin craft-libs; IME click test reads the runtime's reset request; whole-point number label wrap 2026-11-24 21:05:39 +00:00
Denis Gomes c8bcd4ae48 M4: Paste properties keeps a layer's styles and variables
Copy properties took the values and left behind where they come from:
a frame filled from a colour variable or a fill style pasted a plain,
unlinked colour, and the pasted layer's own bindings stayed, so a bound
radius kept its variable's value over the pasted one.

It now also carries the fill, stroke, effect, grid and text style
links, the variables bound to what it copies (not sizes, auto layout
spacing, visibility or text content) and a frame's layout grids. The
pasted layer's bindings on those give way. A style or variable the
target file lacks (a copy from another tab) is left out and its values
pasted, so the paste never fails on a missing link.

Layout grids coming along with a frame is not measured in Figma.
2026-11-24 14:31:53 -05:00
Denis Gomes 4fe03065aa M3: Shift+Cmd/Ctrl+' says whether pixel grid snapping is on
Turning Snap to pixel grid on or off changes nothing on the canvas
until the next drag, so the shortcut gave no sign it had worked. A
notice at the bottom now says "Snap to pixel grid on" or "off", from
the shortcut, the menu and the Preferences row alike.
2026-11-24 14:22:35 -05:00
Denis Gomes 5a875417e7 M8: frames, sections and components land on whole pixels
Figma's help says they "always snap to the pixel grid, even if Snap to
pixel grid is disabled". In FigCraft they followed the setting like any
layer, and since #2031 a snap to a layer off the grid wins over the
grid, so a frame dragged next to a neighbour at 100.4 landed at 100.4
and the whole numbers inside it sat between pixels.

A move, resize or draw of frames, sections, components, component sets
and instances now rounds to whole pixels before and after object
snapping, whatever Snap to pixel grid says. A moved one also lands on
whole pixels of its parent (`snap::settle_on_pixels`), so a frame
already off the grid comes back onto it. Other layers keep #2031's
order: the pixel grid first, then the snap to a layer wins.

The move rounds the drag itself rather than each layer afterwards, so
the preview keeps its shifted-layers fast path for frames already on
the grid.
2026-11-24 14:22:35 -05:00
Denis Gomes 7ce0e374a1 M3: the pixel grid shows on dark as well as on white
The grid was black at 7%, a stroke of one point: it showed on white and
hardly at all on the dark canvas or a dark fill, and on a 2x screen its
lines were two pixels wide. Figma's grid reads 242 on white and 78 on a
grey of 50 (measured 2026-11-24), which a grey of 190 at 20% gives, so
it darkens light colours and lightens dark ones.

The lines are now that grey, one screen pixel wide and centred on the
screen's pixels.
2026-11-24 14:22:35 -05:00
bjurrunandClaude Opus 5.5 747dae244f M7: find New York, macOS's hidden .New York, under its public name
macOS installs Apple's serif New York as `.New York`; a leading dot keeps
it out of font menus, and the scan drops dot families except those in
`public_family`. New York wasn't one, so "New York" was a missing font
and text drew in a fallback. It now joins SF Compact and SF Pro Rounded
there.

Tests: the mapping, and a Mac-only scan of /System/Library/Fonts that
finds New York, keeps dot names out of the list and loads Regular and
Italic as "New York" (skipped where the files are absent).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 20:22:18 +01:00
aiongg f29fc403eb Test round 1: Tab is egui's over FigCraft's dialogs, the first frame draws in its theme, tests follow the runtime's press split 2026-11-24 19:18:50 +00:00
aiongg a396aa6fc6 Cargo.lock for the next-host-input pin; drop an unused test import 2026-11-24 18:46:14 +00:00
aiongg e393abe47f Pin craft-libs next-host-input ea3b99e892 2026-11-24 18:43:24 +00:00
aiongg 3ddb9d46ec Tests: the runtime in the test windows that draw FigCraft's UI
Each such window installs the runtime headless and hands it FigCraft's
frame input before each frame, as the shells do; the main window's
close tests run its close path.
2026-11-24 18:40:53 +00:00
aiongg 51473c7e17 Host FigCraft's egui UI on craft-libs next's runtime
The runtime is installed in the desktop and web app creators, with its
frame input (theme mode, interface scale, direction, FigCraft's F6) in
raw_input_hook, the main window's close decision in its close path, and
before_ui first in the desktop ui. The window's Escape returns to egui
first in each window's frame, and the canvas is the window's document
canvas, so FigCraft's keys reach its own handlers as before.

The update dialogs run on a DialogHost, fonts load through
craft_ui::fonts::load, the interface scale is the runtime's, and the
searchable header menus are app-local. egui's ComboBox is the combo box
on next.
2026-11-24 18:40:53 +00:00
aiongg ad24adbd4a minimal-port rewrite: 1 edits (combo 1) 2026-11-24 18:26:11 +00:00
aiongg efeb1b9a54 minimal-port repin: 39 edits (revs 38, features 1) 2026-11-24 18:25:44 +00:00
supersfera c324c02977 ru: state CC0-1.0 for Russian metainfo strings 2026-11-24 07:10:15 -08: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 c45ffc5496 M8: the browser build compiles the rasteriser for speed
tiny-skia, tiny-skia-path and figcraft-render at opt-level 3 in the web-release profile: their
loops run for every pixel of the canvas on the page's one thread. The rest stays at "z" for the
size gate.
2026-11-24 13:02:34 +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 338318aaac M3: a panel menu taller than the window scrolls
A menu opened from a panel ran past the window's bottom when it had more
rows than fit, and the rows below couldn't be reached. With many colour
variables, the Selection colors Styles menu showed only the first ones.
egui moves a popup to keep it in the window but doesn't shorten one taller
than the window.

menu_popup, context_popup and the row context menus now return a Menu
whose rows scroll with the wheel or the scroll bar once they were taller
than the window last frame, the rule the main menu follows since #2217. A
menu that fits is laid out as before.

A scroll area around every menu's rows was tried first and rejected: egui
lays a popup out in the height it measured last frame, so a menu that grows
(the share popover opening its Advanced part) stayed at its old height and
hid the new rows. Ten share and vote tests caught it.
2026-11-24 03:04:45 -05:00
Denis Gomes 6247922621 M5: a file opens again where it was left
A file always opened on the page saved in it, fitted to its content, so
coming back to a file meant finding the place again. Figma opens a file
where you were.

Closing a file's tab or quitting now keeps the page it showed and each
page's view (centre and zoom) in the preferences, by path, for the last
100 files left. Opening the file shows that page at its view, and the
canvas keeps the view instead of fitting the page when it first gets its
size (DocState::fit_when_sized). A page the file no longer has, a divider
or a view the canvas can't show is left out.

Keeping the view in the file was rejected: it would come back only after a
save, and looking around would make the file unsaved. The preferences are
per machine, so another computer opens the file fitted.
2026-11-24 03:01:16 -05:00
Denis Gomes f9964e14ae Desktop: reopen the files open at quit instead of starting in a new file
The desktop app started in a new, empty file on every launch, and with a
control port open (FIGCRAFT_CONTROL_PORT set for an attached agent) even
the Start on the Home screen preference was overridden, so the files you
worked in had to be found and opened again each time.

Quitting now keeps the paths of the open tabs' files, in tab order, and the
one in front (Prefs::open_files, Prefs::front_file); the next start opens
them again and brings that one forward, as Figma's desktop app reopens its
tabs. Files without a path (new, imported, joined live) and branch tabs are
left out. A file named on the command line stays in front, a recovered
copy keeps its one tab (file.open switches to an open path), a file gone
since is skipped, and one that won't open is reported like a file named on
the command line.

With nothing to reopen the window starts on the Home screen; only with a
control port open does it still start in a new file (#874: control callers
expect a document). Start on the Home screen now means Home instead of the
reopened files.

The list is written at quit only, with the other preferences. Keeping it on
every tab change would cover a crash too, but a crash already brings back
the unsaved files through recovery copies, and the list from the last quit
is a fair fallback for the rest.
2026-11-24 03:00:57 -05:00
Denis Gomes fd45d4f05b M3: a main pasted from its library file into another file is an instance of it
Copying a main component in a library file and pasting it into another
file made a copy of the main there: a new component of that file, not
linked to the library. Copy then Paste of a main in its own file already
makes an instance, and pasting an instance from the library file already
uses the main from the library. Now a main the source file publishes is
an instance of it from that library too, which gets enabled the same way,
as Figma does with a published component. A variant is an instance of that
variant.

A main the library doesn't offer (hidden from publishing, added since the
last publish) and a main from a file that publishes no library still paste
as a copy. Making those an instance as well was rejected: their main would
stay in the other file, so the instance would show a missing main.

The part of adopt_pasted that brings published components in is now
from_published, shared with the new published_main.
2026-11-24 03:00:27 -05:00
Denis Gomes 80c68ee7a9 M1: Paste over selection with several layers selected pastes after the last of them
With several layers selected, Shift+Cmd/Ctrl+V took the first one selected,
so the copies landed among the others. It now pastes after the last selected
layer as seen: the last in one auto layout frame's flow, else below the lowest
at the selection's own gap, or right of the rightmost for a row. One selected
layer is unchanged.
2026-11-24 02:58:00 -05:00
Denis Gomes fe25e194d1 M7: Save as to another file names the tab after that file
Save as kept the document's name unless it was Untitled or the old
file's own name (#935). A file opened from an import (.fig, .penpot,
.sketch) carries its source's name and has no file yet, so after Save as
to Other.figcraft its tab still showed the source's name; a file renamed
here did the same. The tab and the file on disk then disagree, and the
file can't be found by the name on its tab.

Saving to another file now always names the document after it, as a
desktop app's document window does. Saving to the same file keeps a name
given here, so a name a file name can't hold (with a colon, say) stays
until the next Save as.

Keeping a name chosen here across Save as (the #935 rule) was the
alternative; it is what left imported files with names no file has.
2026-11-24 02:57:37 -05:00
Denis Gomes 8056e20dcf M3: a variant switch keeps typed text the other variant nests in other frames
Switching an instance to another variant matched its old layers to the
new variant's by source and then by name path. When the two variants nest
the same text layer differently (text > Label in one, div > text > Label
in the other), the path differs, the typed layer matched nothing, and the
new variant's own text came back.

A text layer of the new variant that nothing else matched now takes the
old text layer of the same name, when exactly one layer on each side has
that name. Two of one name stay unmatched, since either could be the one
typed into. Layers inside nested instances are left to their own mains'
rebuild, so a text layer never moves between instances.

Matching every layer kind by name alone was left out: a fill or size kept
from another place in the tree would land on a layer that only shares a
name, while text is what was typed and the layer most likely to be the
same one.
2026-11-24 02:57:37 -05:00
Denis Gomes 782b2ea369 M4: Tab while editing a text layer goes on to the next text layer
Tab while editing a text layer typed a tab character, and Shift+Tab did
too, so filling in a form built from instances took a double-click into
every label. Tab now ends editing the text and edits the next text layer
with all of its text selected; Shift+Tab goes to the previous one.

The order is reading order: rows top to bottom, each left to right; two
layers share a row when they overlap vertically by at least half the
shorter one's height. The candidates are the text layers of the same
top-level frame or group, at any depth and inside instances, that are
visible and unlocked along with every layer around them; a text on the
page or in a section goes to the texts beside it. At the last text Tab
does nothing, and Shift+Tab at the first.

Tab keeps nesting a list item, typing two spaces in a code block and
typing a tab in a board object's text or a widget's field. The view
doesn't follow a text that is off screen: nothing in the app scrolls a
layer into view yet.

Two rows of text_tail_tests::list_keys_at_list_items asserted that Tab
outside a list types a tab; they now assert the text stays as it was.
2026-11-24 02:57:36 -05: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
takasurazeem ee1fad7a6d M3: a variant switch lays out stretched children like a fresh instance
An instance switched to a variant of another size kept the old variant's
laid-out sizes on layers matched to a different variant's layers, then
auto layout applied the parent's resize on top of children that already
held the new main's sizes. keep_laid_out now keeps them only for a layer
that mirrored the same main layer.

Fixes #2585.
2026-11-23 15:45:37 -05:00
Dylan M. Taylor c01d391df7 revert: restore scheduled release.yml dry-run on main (#2582) 2026-11-23 14:45:06 -05:00
Dylan M. Taylor e1d80e0353 ci(release): publish scheduled nightly prereleases (#2581) 2026-11-23 13:16:59 -05:00
ljkx f8f955681d Swap library: the mode remapping in a function of its own 2026-11-23 18:10:40 +01:00