Commit Graph
4126 Commits
Author SHA1 Message Date
dotCooCoo ec8c1cb8d1 Intertwine: a right-click where three or more objects overlap arranges the nearest one
Squashed from #4862 onto main.
2026-11-01 00:36:29 +07:00
dotCooCoo d6297dbfb9 .ai import: type comes from the text document alone when every shown story reads
Squashed from #4865 onto main.
2026-11-01 00:35:35 +07:00
dotCooCoo bb6cbfb2b4 Images: SVG and EPS export write colorized grayscale and 1-bit images in their fill color
SVG export ignored an image's colorize paint and wrote the image's own
black, white and gray pixels. EPS export flattened every colorized image
into a process-color raster, so a spot color lost its plate. Both now
write the image in the fill color, with the coverage the canvas and PDF
export use (darkness times alpha), so white and transparent pixels take
no color.

- SVG writes a coverage PNG as a mask over a rectangle in the color,
  shared between repeated images while each keeps its own color. Linked
  mode writes the coverage PNG as a file, and SVG Tiny 1.2 writes a PNG
  in the color. A colorized image whose pixels are missing, or whose
  grayscale pixels can't be decoded, is left out with a warning.
- EPS writes fully covered or uncovered pixels as an imagemask in the
  color's process or Separation ink (Registration on every plate), and a
  grayscale image as ink samples scaled by coverage. Level 3 masks its
  uncovered pixels out and Level 2 writes them white; gray midtones are
  written over white, with the existing warnings.
- EPS flattening no longer counts a solid colorize paint on a grayscale
  or 1-bit image as transparency by itself. Opacity, blending modes,
  opacity masks, effects and overlapping transparent art still flatten
  it, and so does a colorize paint the writer can't draw.

The svg crate's tests turn on resvg's raster-images feature to render
the embedded PNGs.

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-01 00:35:27 +07:00
dotCooCoo 93e27cafd3 PDF/EPS export: live art expanded for pattern tile images counts against the object limit
Blends, envelopes, repeats and Intertwine groups that hold a pattern fill
with a transparent tile image were each expanded under a limit of their
own, so many of them together had no limit. Their art now counts toward
the same limit as the pattern tiles, and an object whose art would pass
it stays live.
2026-11-01 00:35:23 +07:00
dotCooCoo a32a7cbb0d PDF/EPS export: EPS export and PostScript printing expand pattern tile images once
EPS export expanded the pattern fills whose tile images need flattening and
then flattened the result with flatten_document, which expanded them again
with a new object limit. PostScript printing did the same, on the layers
shown rather than the layers that print. EPS export now flattens the
expanded document without expanding it again (flatten_expanded), and
PostScript printing leaves the expansion to the flattener, which runs on
the layers that print, and only checks for such pattern fills to warn.
2026-11-01 00:35:23 +07:00
dotCooCoo e2fddc6b12 PDF/EPS export: pattern fills whose tiles pass the object limit stay pattern fills
The expansion counted the objects a pattern fill made only after making
them, so one shape could clone up to 250,000 tile positions times the
tile art's objects past the limit. Each fill now counts its tiles before
they are made, and after outlining strokes and effects for turned or
sheared tiles, and keeps room for the copy and group of the fills after
it. A fill that does not fit stays a pattern fill.
2026-11-01 00:35:23 +07:00
dotCooCoo c09ea59731 PDF/EPS export: transparent images in patterns nested in tile art flatten
A pattern fill in a pattern's tile art that paints a see-through or
colorized image was not counted, so PDF 1.3 export kept it as a
pattern and failed on its transparency. Detection now follows pattern
fills in tile art down to the three levels the canvas draws, skipping
hidden tile art, and the tiles the expansion makes are expanded again
for them. Expansion stops once the expanded art holds MAX_GENERATED
objects.
2026-11-01 00:35:23 +07:00
dotCooCoo 6dfda4db76 PDF/EPS export: pattern tile images in live art and hidden shapes flatten as drawn
Blends, envelopes, repeats and Intertwine groups that hold a see-through
or colorized pattern tile image are expanded into the art the writers
draw for them before the tiles are expanded, so those tiles are
flattened too. Random Transform effects in that art are baked first.

Hidden shapes, shapes in hidden groups or layers and template layers are
skipped: expanding a hidden shape made its tiles show in the file, and
art that is not written no longer makes a flattened copy of the document.
2026-11-01 00:35:23 +07:00
dotCooCoo 7b4d6282f1 Flattening: an option leaves colorized images to writers that draw them
Flattening counted every colorized image as transparency, in the art and
in pattern tiles. A new flattener option, keeps_colorize, stops counting
an image colorized with a solid paint whose pixels are grayscale or 1-bit,
for a format whose writer draws such images in their ink. Opacity,
blending modes, opacity masks and effects still flatten them, and pattern
tiles are still expanded for those. The option is off, so exports flatten
as before; the EPS writer that draws colorized images turns it on.

The EPS pattern tile tests now check the exported colors, and a tile
group with opacity for the warning.
2026-11-01 00:35:23 +07:00
dotCooCoo 33ab5adbc2 PDF/EPS export: flatten see-through and colorized pattern tile images
PDF 1.3, PDF/X-1a, PDF/X-3, EPS and PostScript printing flatten
transparency with `flatten_document`, which only looked at art in the
layers. An image with see-through pixels, a colorize paint, opacity or
a blending mode drawn only through a pattern fill stayed in the pattern
definition, so the flattener returned early and the writer drew the tile
opaque and uncolorized (PDF 1.3 export failed on the transparency left).

`flatten_document` now first expands pattern fills whose tile image
needs flattening into their tiles, as legacy .ai save does. See-through
tile pixels count only where the caller counts see-through images (PDF
1.3); EPS level 3 already masks them out. The EPS and PostScript print
transparency warnings now see those tile images too.
2026-11-01 00:35:23 +07:00
Wadah Badawi c35b51eb0f Intertwine: object.intertwine.arrange takes an id without a selection 2026-10-31 23:48:56 +07:00
Wadah Badawi 6eea3a5178 Pathfinder: Crop works on a selected group of shapes 2026-10-31 23:48:55 +07:00
dotCooCoo 6fb9152fa7 Blob Brush: the tip preview test checks that a drag gives it the focus
The test moves the focus to the Roundness field before the drag and
steps the Angle with an arrow key after it, so it fails if a drag stops
giving the preview the keyboard focus.
2026-10-31 23:48:55 +07:00
dotCooCoo 5751dcc293 Blob Brush: the tip preview is a named Angle slider with arrow keys
The tip preview square in the Blob Brush Tool Options set the Angle by a
drag but had no accessible name, no value and no keyboard control.
Screen readers now get it as the Angle slider with the Angle in degrees
as its value. A click or a drag gives it the keyboard focus, and the
arrow keys, Shift with an arrow, Page Up and Page Down, Home and End
step the Angle within -180 to 180 degrees, as the dialog sliders built
on color_slider_stepped do (crates/ui-egui/src/widgets/color.rs). The
new widgets::stepped_area gives a caller-drawn control that slider's
screen-reader node, focus, keys and focus outline.
2026-10-31 23:48:55 +07:00
dotCooCoo e8b1f1187d Tests: a pixel layer nested in Affinity text stays an image inside the clip
objects_nested_in_text_are_clipped_by_the_type now also nests a 4 x 4 Rstr pixel layer under the TxtA and checks that it is read as an image in the clipping group, next to the shape.
2026-10-31 23:29:39 +07:00
dotCooCoo a48ab7f8c6 Fix #3325: art nested in Affinity text is clipped to the characters
An Affinity text object whose children are nested in it (an image dragged
into artistic text, for example) opened as a plain group, so the image
was drawn over the text. The text now becomes a clip group whose
clipping path is the type, as a shape with children already does: the
nested art shows only inside the characters, with the characters' fill
behind it and their stroke over it.
2026-10-31 23:29:39 +07:00
dotCooCoo 77bdf478e4 Perspective: a homography product that overflows is refused instead of stored or drawn
Homography::then_after returned products whose entries could overflow to
infinity or become NaN. A move, transform or grid reproject of type or a
symbol instance whose stored projection has large finite entries stored such
a product, and the type was then drawn flat, since a projection that is not
finite reads as none.

- Homography::checked_then_after returns None when an entry of the product
  is not finite.
- project_node composes each type and symbol instance projection with it and
  returns false, leaving the object as it is, when one would not be finite;
  moves and transforms in perspective and Define Perspective Grid with
  reproject then return the horizon error and leave the document unchanged.
- transform_map, attach_homography and size_homography return None for such
  a product.
- Edit Text returns the horizon error, and does not enter isolation mode,
  when the type cannot be shown flat where it is drawn.
2026-10-31 23:29:37 +07:00
dotCooCoo f9e78eb144 Appearance: effect.apply reports the active row's object, and an empty aligned target list is an error
effect.apply now reports the item of the first selected object, whose row
the active item is. With nothing selected, an explicit aligned item returns
the command's error instead of an internal error.
2026-10-31 23:29:35 +07:00
dotCooCoo a32d6364ec Appearance: paint, stroke and effect edits change the active row of the first selected object
The Appearance panel's active row is a row of the first selected object's
stack, but fill, stroke, gradient and effect edits matched it against the
object that paints first. When the selection was made top object first and
the objects' stacks differ, an edit changed another row: with the red fill
of [red, white, Stroke] active above a [white, Stroke] object, Fill set the
white row instead.

These edits now match the active row against the first selected object (or
the compound path holding it), as Add New Fill and Reduce to Basic
Appearance already do. Gradient edits also read whether the active row is a
fill or a stroke from that object.
2026-10-31 23:29:35 +07:00
dotCooCoo 4c32032d34 Part of #3602: a node thumbnail reports the size it is drawn at
render_node_thumbnail_with draws into a context of size.clamp(1,
MAX_CONTEXT_SIDE) pixels but reported width and height as the requested
size, so a size of 0 gave a 0x0 image holding 4 bytes. The view was
also built from the requested size, and the fit scale (size - 2) /
extent was 0 or negative at sizes 1 and 2, so the art drew nothing or
mirrored.

The thumbnail now reports the side it draws, builds the view from it,
and drops the 1-pixel margin when the side is too small to keep one.

Test: node_thumbnail_reports_the_size_it_draws.
2026-10-31 23:29:33 +07:00
bflatastic f0da383749 Smooth: the slider smooths bumps and jags into curves, and smooths only a direct-selected section 2026-10-31 23:10:56 +07:00
bflatastic 06043139e6 Fix #4893: New Document saves a preset after More Settings 2026-10-31 22:22:30 +07:00
bflatastic cd2b5f77a4 Fix #4882: Rasterize to CMYK makes a CMYK image 2026-10-31 22:22:27 +07:00
bflatastic 83c158703a Fix #4891: Direct Selection selects and moves an object by its center point
Docs: ui-parity and target-app-parity rows for #4890 and #4891.
2026-10-31 22:22:19 +07:00
bflatastic 427de74f37 Fix #4890: Alt with Direct Selection marquee-selects whole paths 2026-10-31 22:22:17 +07:00
bflatastic ca0785573d Add-ons: Arrange Tools — Arrange in Grid, Swap, Replace with Top Object, Set Size of Each, Zoom to Selection
A built-in add-on in Object › Plug-ins › Arrange Tools (#4830, #4831, #4832, #4833, #4834):

- addon.arrange.grid lays the top-level selected objects out in rows and
  columns, a row or a column (stacking order from the back, visual bounds,
  each object centred in its cell), from the selection's top-left or
  centred on the artboard.
- addon.arrange.swap swaps two objects' bounds centres, and with `size`
  their widths and heights.
- addon.arrange.replace puts a copy of the topmost selected object centred
  on each of the others, in its stacking place, kept, stretched or fitted
  in proportion; the replaced objects are deleted unless `keep`.
- addon.arrange.size gives each selected object an exact width and/or
  height about a reference point.
- addon.arrange.zoomSelection (a UI command) fits the active view to the
  selection.

Places and sizes are measured as object.setBounds measures them (its
transform, now also available per object), strokes scale as Scale Strokes
& Effects says, each command is one undo step, and Arrange in Grid,
Replace with Top Object and Set Size of Each open previewed dialogs.
Catalog rows, command sweep cases, docs/mcp.md, parity docs and the
ROADMAP progress log.
2026-10-31 22:22:15 +07:00
bflatastic 7a2acbc178 Export for Screens: the dialog is laid out as Illustrator's 2026-10-31 21:43:13 +07:00
bflatastic b8e5f7088f Export for Screens: Export PDFs As Single file writes the artboards as one PDF's pages 2026-10-31 21:43:13 +07:00
bflatastic 54b0c7266c Fix #4826: Artwork Cleanup's Join Point Text stacks one-line type into one object 2026-10-31 20:44:15 +07:00
Shunsuke Yoshizawa aaeb1b2b35 Respect SVG image-rendering pixelated attribute 2026-10-31 20:44:09 +07:00
NetterSilverandClaude Haiku 5.5 6664e366e7 Reject repeated '#' in perspective grid colour parser
Found while testing crates/tools/src/distort/perspective/define.rs:84-86 (Rgb::parse)

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-31 20:44:07 +07:00
NetterSilverandClaude Haiku 5.5 c0872ff9c6 Fix enhanced_preset Shapes for decorated High Fidelity Photo names
Found while testing crates/trace/src/params.rs:248-251 (enhanced_preset)

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-31 20:44:04 +07:00
dotCooCoo b0f6174c37 i18n: Dutch names a brush 'penseel' everywhere, with neuter agreement 2026-10-31 20:44:01 +07:00
bflatastic 672a5342a6 Fix #4817: Properties' Quick Actions has Blend Options for a selected blend with any tool 2026-10-31 19:44:50 +07:00
bflatastic 78a68bd8ec Fix #4835: Artwork Cleanup's Duplicate Objects finds type set twice in the same place 2026-10-31 19:43:17 +07:00
bflatastic 437280315f Fix #4803: Enter or Escape in a floating panel's field stays in the field 2026-10-31 19:43:17 +07:00
bflatastic 13bac047f3 EPS import: spend keeps its own doc comment 2026-10-31 19:43:17 +07:00
marshiyar bd0601c780 EPS import: big operators are charged for the bytes and objects they touch (#3584)
putinterval, copy of a string, roll, counttomark, clear to mark and cvn
worked on up to 4 MiB or 100,000 objects for the one operation each is charged,
so a small file looped over them could keep the importer busy for hours within
the operation budget. Each now spends one operation per 256 bytes or objects.

Fixes #3584
2026-10-31 19:43:17 +07:00
bflatastic 9efe6dc764 PDF import: a font name's family is looked for at no more than 16 of its hyphens
The name comes from the file, and each lookup walks it, so a name made of thousands of hyphens took quadratic time.
2026-10-31 19:43:17 +07:00
Don Omondi 1883e5342d PDF import: find installed fonts named with hyphens or a composite font's CMap
- A composite (Type 0) font is noted by its descendant CIDFont's BaseFont
  (ISO 32000-1 9.7.4.1), not its own BaseFont, which ends in "-" and the
  CMap name (9.7.6.1, e.g. Name-Identity-H); without one, the CMap name is
  taken off the end of the BaseFont.
- A font name's family is the longest part before a hyphen (or the comma of
  Arial,Bold) that names an available family, so Noto-Sans-Bold is Noto
  Sans, Bold and Noto-Sans-CJK-JP is Noto Sans CJK JP; a shorter family
  still matches when no longer one is available.
- A missing font is split only at a comma or before the first part that is a
  style word (Helvetica-BoldOblique); otherwise the whole name is its family
  (MS-PGothic is reported as MS PGothic, not MS).

Synthetic tests (no host fonts): Families::of builds the family list.

# Conflicts:
#	docs/file-format-parity.md
#	docs/gaps.md
#	docs/type-parity.md
2026-10-31 19:43:17 +07:00
SusieeTheFemboyandClaude Opus 5.5 2e7b2b7f96 SVG import: an embedded SVG image gets the feConvolveMatrix order check too
Files::svg parsed nested SVG images with usvg without the check the top-level
import makes, so an overflowing order inside an <image> still reached usvg's multiply.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 19:43:17 +07:00
SusieeTheFemboyandGLM-5.3-Flash c7dc443ee1 SVG import: a feConvolveMatrix order that overflows usvg's multiply is refused
usvg 0.48 casts the filter's order attribute through i32, so a value like
1066570220609 saturates and the u32 order_x * order_y multiply overflows.
Only debug and overflow-checks builds panic on that; release builds already
import the file — the multiply wraps, and VectorCraft drops the filter as
an unsupported primitive with a warning, so nothing reaches the document,
render or export (observed on main in a --release build: both repro files
import without error; with a one-entry kernelMatrix the wrapped product
2147483647² mod 2³² = 1 even passes usvg's length check and leaves a filter
claiming a 2147483647×2147483647 kernel, still dropped downstream).

The import now parses order the way usvg does (svgtypes numbers, the same
as-i32 cast with its saturation, the first side defaulting the second, both
positive or both back to the 3×3 default) and refuses exactly the one case:
when the product of the two sides overflows u32 (checked_mul). Any order
usvg can multiply keeps importing as before, however large on its own, and
a missing, unparseable or non-positive order still falls back to 3.

Regression tests cover the overflow repros, the release wrap case, large
but fitting orders (100, 80 80, 65535 65535, 2147483647 1), the
pass-through shapes, and sane kernels, in debug and in release.

Co-Authored-By: GLM-5.3-Flash <noreply@z.ai>
2026-10-31 19:43:17 +07:00
Don Omondi 1679318034 Type: lam-alef highlight follow-up: optional features, all marks, exact ligature test (#394)
Highlight Alternate Glyphs no longer drops a lam-alef cluster's glyphs
outright: the ligature is clear when required shaping, or shaping with
liga left on (older fonts), gives it, so an optional feature such as
salt that changes it is highlighted again. is_lam_alef takes any
combining mark by Unicode general category (Arabic Extended-A/B/C
included) instead of a partial list. The test font maps the fatha to a
mark and skips marks in its ligature, so the mark-spanning test checks
the exact ligature glyph and cluster; it gains a salt lookup and test.

Also a one-line equivalent nonminimal_bool repair in pathops'
pathtools that strict Clippy needs on main.
2026-10-31 19:43:17 +07:00
NetterSilverandClaude Haiku 5.5 7ae9f2c4e5 Keep an empty text value in dataset CSV export and import
Found while testing crates/engine/src/cmd/variablecmds/csv.rs:146 (csv_escape) and :158-163 (cell_to_value)

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-31 19:43:17 +07:00
Don Omondi 22b1c6bc2e Fix #3085: DXF LAYOUT objects write only the group codes the DXF Reference defines
The PLOTSETTINGS part of each LAYOUT wrote the paper image origin as a point
(148 and 158), but the origin is two values at 148 (x) and 149 (y), and 158 is
not a PLOTSETTINGS code. Strict readers such as Autodesk Fusion can reject the
file. The ezdxf re-save the reporter found Fusion accepts differs from our export in
these objects, not in the geometry.

- 148/149 for the paper image origin
- shade plot mode, resolution level and DPI (76/77/78) from DXF 2004
- plot flag 1024 (model type) on the Model layout
- the plot style ACDBPLACEHOLDER without a subclass marker

Test r2000_and_later_files_have_the_structure_cad_apps_require checks the
required sections and table entries, handles below $HANDSEED, references
that resolve, and LAYOUT group codes.

# Conflicts:
#	docs/file-format-parity.md
2026-10-31 19:43:17 +07:00
marshiyar 4861fb9d85 Engine guard: a recovered panic restores every document's undo history and the active document (#3599)
run_guarded put back only the active document's art, selection and interaction.
An undo step pushed before the panic stayed (Undo then stepped to a state equal
to the current one) and Redo was lost; other documents a command touched kept
their half-applied edits; the active document was restored by index.

It now snapshots every open document with its history and restores them, and
the active document by uid.

Fixes #3599
2026-10-31 19:43:17 +07:00
Don Omondi 7403003fb1 fix(eps): an envelope's contents being edited aren't read as art
An envelope whose contents are being edited is written the other way
round from one that isn't: its contents, a group on `%_` lines, then
its dictionary, which holds the mesh that shapes them. Only a group of
meshes was left out before an envelope's dictionary, so those contents
were read as art and their undistorted shapes drew over the distorted
art that follows on plain lines (and that the page draws).

The group on `%_` lines before an envelope's dictionary is now left
out whatever it holds; text in it stays as hidden text, as the
dictionary's own source text does.

# Conflicts:
#	docs/file-format-parity.md
2026-10-31 19:43:17 +07:00
Don Omondi 5b15b3f56b fix(eps): a transparency set in a dictionary's art stays after it
Art inside a dictionary in the editing data, such as an area text's
frame (`/ConfiningPath`) or a mask's art, can set a transparency
(`Xy`). The writer goes on from it: the objects after an area text
whose frame sets one have no `Xy` of their own. The reader dropped
that state when the dictionary closed, so those objects took the
transparency before the dictionary instead; in a user's file a Lighten
glow before an area text made everything after it fade into the light
background.

The last transparency the art inside a dictionary sets is now the
current one after it (and the enclosing dictionary's). Dictionaries
outside the layers (the setup's styles) are left as they were.

# Conflicts:
#	docs/file-format-parity.md
2026-10-31 19:43:17 +07:00
Don Omondi 75d2736a2a fix(eps): area type's first line goes where the file lays it out
Area type made from the editing data's text document was laid out with
its first baseline the font's ascent below the frame's top. The text
document keeps where each of its lines starts, and the file's page draws
them there: for some fonts the first line sits well above the font's
ascent (Oswald's at about its cap height), so headings came in lower
than on the page and the layers were taken to differ from it.

When the file's first line is more than half a point from where it is
laid out here, the first baseline is now fixed where the file has it
(First Baseline: Fixed), measured in the text document's own frame so a
copied object's type moves with its frame.

# Conflicts:
#	docs/file-format-parity.md
2026-10-31 19:43:17 +07:00
Don Omondi 3602bd6ea3 fix(ai-import): type from the text document takes its character style's attributes
Type made from an Illustrator file's text document took each character
attribute its run doesn't set from the document's base attributes, not
from the character style the run names ([Normal Character Style] or
another of the file's). Where the two differ the type came in wrong: a
file whose base fill is white and whose Normal Character Style is black
came in with its text white, invisible, so the layers differed from the
page wherever the page's own type didn't stand in for it.

A run now takes its own attributes, then its character style's (and the
styles that one is based on, up to 16), then the document's.
2026-10-31 19:43:17 +07:00