Found while testing crates/engine/src/cmd/typemenu.rs:614 (unicode_char)
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The boolean's answer went through orient(), which judges each ring's
side from its first point. The boolean often starts a contour where it
touches another, so a triangle whose tip rests on a square's edge was
dropped, and an even-odd hole touching its outline was filled. The
boolean already runs holes against their outlines, so its rings are now
only turned as a whole.
Other fixes:
- A bowtie drawn as one contour has no area of its own. It was dropped
before the meet check and built nothing, although it fills both lobes.
Sampling now keeps rings with no area, and orient() drops them after
the check. Flat rings, every point on one line, fill nothing and are
still dropped, so a stray flat contour doesn't send separate art
through the boolean.
- An open subpath was closed along its end handles when the profile went
through the boolean, but straight otherwise, as the renderer fills it.
It is now closed straight before the boolean too.
- An empty union was taken as a refusal. Contours that cancel (a square
drawn twice under even-odd) built a square. They now build nothing.
- Contours meet within twice the boolean's own sweep tolerance,
computed by its rule from every anchor and handle of the path it is
given. pathops snaps anchors onto nearby heights before the sweep
joins edges within that tolerance, so contours up to about 1.4 times
it apart can come out as one; within twice it, every contour it
might join goes through it, even far from the origin, and the few it
leaves apart cost a boolean that builds the same shape.
- A one-anchor subpath draws nothing, so it is skipped, as the renderer
and the boolean skip it.
- A profile the boolean refuses reuses the rings already sampled.
Tests:
- touching parts and holes;
- an open subpath with handles, alone and beside crossing bars;
- a flat contour beside separate squares;
- contours joined far from the origin, including by handles alone,
and contours a few millionths apart near it kept apart;
- triangles snapped together and joined at 1.4 times the tolerance,
the same triangles left apart and kept whole, and the factor pinned
between 1.9 and 2.2 times, with the worst case just past twice the
tolerance left apart by pathops;
- a 24-bar grid: too complex for Extrude and Inflate, whole under Rotate;
- the merged rings turned as a whole;
- a one-anchor loop;
- the bowtie and the cancelling squares under all three effects;
- a 3,001-point star that the boolean refuses (TooComplex), built as
drawn.
Docs: the pathops README's Limits section now says only the try_
functions refuse, lists OpenPath and the caught panic, and describes
unite_all's answers, and which calls take a precision. three-d.md and effects-parity.md (the 3D row, its
history and status line) describe the merge and its limits.
The boolean that merges crossing contours cost about as much as the rest
of a plain extrusion, and it ran on every profile. Most art has no
contours that meet, so the profile is now sampled first (its point limit
checked there, before any boolean) and resolved only when two edges
cross, touch, run along each other or fold back, in one contour or
across two. Edges are swept by their left ends, within a pair budget past
which the boolean decides. Touching counts: squares sharing an edge
inflate as one puff, not two with a seam.
On a release build, Extrude of 120 separate contours takes 0.31 ms
instead of 4.18 ms; profiles that do cross cost what they did.
Tests: the meeting cases, squares sharing an edge, the fallback for a
profile the boolean refuses, Inflate's extent and area for the crossing
k, and the coincident circles' area. The hairline test now holds a
crossing pair so that its profile still goes through the boolean.
Docs: the merge is described once for all three effects, linking to a new
Limits section in the pathops README instead of repeating its limits,
and the point limit notes that a merged outline can have more points.
try_normalize refits its result at Pathfinder's default precision and
drops every contour thinner than 0.01 pt on average as a sliver. A
hairline beside a larger shape is art, not debris, and resolved() only
fell back to the input when nothing at all was left, so the hairline lost
its cap, walls and surface.
Resolve with try_unite_all_with at a precision far below any art, which
still drops the debris a boolean leaves where curves coincide: a circle
drawn twice, exactly or 1e-7 pt off, stays one outline.
Extrude & Bevel, Inflate and Rotate broke on shapes whose contours cross.
Type often draws a glyph that way: Roboto Slab's "k" has its arm and leg
as one contour that crosses both the stem and the leg's foot serif.
rings() decided each contour's role (outline, hole, or no edge at all
under nonzero) from the contour's first point only. A contour that starts
inside another was dropped or flipped into a hole, cutting part of the
glyph away. A contour that starts outside was kept whole, so its walls and
bevels ran through the overlap and the overlapping parts drew as separate
boxes.
The profile now goes through vectorcraft_pathops::try_normalize first, so
rings() only ever sees simple contours that do not cross. A path the
boolean refuses is used as it was.
The direct-open test only had the editing data keys, so it opened from
the PDF part. It now has two artboards and a layer that exist only in
readable editing data. The keys-only case stays as its own test.
The editing data of a .ai or .ait holds every artboard, so a multi-page
file has no pages to pick. Opening one now goes straight to it, as a
file carrying its VectorCraft document already does. The dialog stays
for PDFs, a .ai that is only a PDF, a password, and Place.
Resolve missing Registration (Xs, XS, Xz, XZ) and named color (Xx, XX)
operators in AI ArtStyle filter definitions so objects styled with
Registration swatches correctly resolve their paint instead of falling
back to the previously set graphics state color.
Also exclude Registration paints from color-model inference when read via
Xx/XX, and correctly extract tint (penultimate operand) for name-free Xz.
Found while testing crates/engine/src/cmd/patternlib.rs:99 (existing_pattern)
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A document without a saved view was fitted once, to the canvas of the first frame that shows it, and the window's layout can still move the canvas's edges over the next frames. Two starts of the app then opened one file at zooms a hair apart (4.9812 and 4.9883 in a CI probe of v0.21.0, the canvas and the view's centre alike).
The opening fit now follows the canvas until the view is moved or the user presses a button or a key, types, scrolls or zooms (CanvasCache::opening_fit). After that a canvas that changes keeps the view, as before.
A document without a saved view is fitted to the canvas of the first frame that shows it. The test lays that frame's canvas out 2 points narrower than the next, and expects the zoom the settled canvas gives. It fails until the opening fit follows the canvas.
The artboard and asset file stems came from unique_file_names, which turned
every character except letters, digits, - and _ into a dash, so the dot of
example.artboard became a dash. Export for Screens now uses a variant that keeps
dots (a name of only dots takes the Artboard-N fallback); safe_file_name still
drops trailing periods and guards device names.
Test: an_artboard_name_keeps_its_dots.
Two problems in the Character Styles panel and its options dialog.
Opening the options took the panel menu's item, which is easy to miss; a double-click on a style's
row did nothing beyond applying the style a second time. A double-click on a user character style's
row now opens its Character Style Options (`ui.charStyleOptions`), as the menu item does. A single
click still applies the style, the second click of the double-click does not apply it again (the
Normal style's included), and with Shift, Cmd/Ctrl or Alt held the double-click only follows the
click rules. The built-in Normal style opens no dialog. Double-clicking a paragraph style's row similarly opens
its options, which are the rename dialog the Paragraph Styles panel menu opens (`ui.paramDialog`
running `paraStyle.rename`): paragraph styles have no full options window yet.
The dialog then grew with its content: the General section lists every attribute of the style, so
the window covered the screen and its buttons could sit below it. The content now scrolls both ways
inside a window at most 420 points tall (less on a short screen) and never wider than the points
left beside the section list, with one scroll offset per section. The dialog keeps a fixed width of
720 points, enough for the widest section's controls, in every section. The content's height is the
space the footer leaves, measured from the footer drawn last frame, so a large interface scale's
taller footer is reserved too and OK and Cancel stay visible. The section list stays outside the
scroll area, so scrolling a long section never moves the navigation; the section is read after the
list handles a click, so a newly picked section gets its own scroll offset in the same frame.
Tests:
`panels::text_styles::tests::double_clicking_a_character_style_row_opens_its_options` selects text,
double-clicks a character style's row and checks the dialog opens with the style's name, one apply
ran from the first click and the second click applied nothing; a paragraph style's row opens none.
`double_clicking_the_normal_style_opens_no_options` checks the Normal style opens none and is
applied once.
`dialogs::char_style_options::tests::the_sections_scroll_in_a_window_shorter_than_the_general_list`
draws the dialog on a 900 by 560 point screen and checks OK and Cancel stay on it, the dialog keeps
its 720-point width in two sections, and the General list is taller than its scroll area.
`every_section_and_the_buttons_fit_the_smallest_window` checks the app's minimum 800 by 500 point
window in all five sections: every section label, OK and Cancel are on the screen.
`a_scrolled_section_keeps_its_offset_after_switching_away_and_back` scrolls General, clicks Basic
Character Formats and then General again, and checks General''s content returns to the same place:
the section is read after the list handles the click, so no other section stores its offset.
`every_section_and_the_buttons_fit_the_smallest_window_at_twice_the_scale` checks the same in the
400 by 250 points the minimum window holds at 2x UI scale, before and after a wheel scrolls the
content.
Docs: type-parity (a panel row and the revision history), ui-parity (a panel row and the revision
history), target-app-parity (two evidence bullets and the revision history) and roadmap (the
revision history), with the status lines updated.
Found while testing crates/doc/src/assets.rs:43 (Document::next_asset_name)
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
`label_inputs_by` skips controls that already have a name, so colour wells stayed "Color" and sliders kept their internal text. Name them from the visible row label, on both halves of a slider across focus changes, and keep action button names.
The Preferences labeled() helper painted the visible label and then drew
the input beside it without associating them. Call label_inputs_by so
screen readers and the test harness can find each field by its label.
Gradient and rotate-view harnesses looked up widgets by egui Id debug
source strings (for example ".with(…)" and "rot-combo"). Those names
exist only with debug assertions, so the same tests panic in --release.
Resolve widgets from stable scope salts / AccessKit labels instead, which
work in both profiles.
With the Rectangle and Ellipse tools, Cmd lends the selection tool chosen
last, and Copy already took the anchors Direct Selection picked. The
Curvature tool, which Cmd lends Direct Selection, copied the whole path
before this PR, as the Pen did.
The remembered selection is now tied to the document it was made in, by its
uid, instead of being cleared on every tool reset: another view of the same
document, or closing an inactive tab, kept the anchors picked but made Copy
take the whole path.
A lent gesture that leaves the selection as it found it (a Cmd+Shift marquee
over nothing) is no longer recorded as a pick, so the Pen's last anchor stays
its own and Copy takes the whole path.
Also records #6123 in target-app-parity.md.
With the Pen or Curvature tool, Copy and Cut ignore the anchor selection,
so that the last anchor the Pen leaves selected doesn't make Copy take just
that anchor (#2122). Anchors picked with the Direct Selection that Cmd/Ctrl
lends those tools were ignored too, and the whole path was copied.
The session now remembers the selection the lent tool leaves when it gives
the tool back. While that is still the selection, Copy and Cut take the
picked anchors and segments, as with Direct Selection chosen.
Found while testing crates/svg/src/import/css.rs:20 (parse_decls / split_decls)
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
With Direct Selection, a Shift-click on a corner widget toggled its
corner. With the path selected whole every corner already is, so the
first Shift-click deselected the corner clicked and hid its widget,
leaving the others. While every corner is selected, a Shift-click now
picks that corner alone, as the first click of "click one widget, then
Shift-click the others" does; with some corners picked it still toggles.
Found while testing crates/render/src/encode/psd.rs:225
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Each rib of a dashed stroke with a width profile looked up to 256 points
either way along the path, asking the profile at every step, and reached
as wide as the stroke gets anywhere past that. A sliding maximum over the
points' precomputed cover now gives every rib's reach in time in
proportion to the points, with no bound and no fallback to the widest
width (review on #6093).
With a width profile, every slice of a stroke gradient (along or across)
reached as far as the stroke is wide anywhere. Where the stroke crosses
or runs close by itself, the later, narrower part painted a square of
its colour over the wider part beside it, clipped only to the whole
outline. Each rib now reaches as far as the stroke is wide there and on
its way to the next points (each side of a profile stays between its
widths at a span's points); for a dashed stroke, as wide as it gets
within a cap's reach, since caps and dots reach along the path.
The mask test now checks the whole fill and stroke (colour, overprint,
width, cap, join, miter, dash) and the fill rule against the owner's,
and that an object after the mask's dictionary paints with the owner's
paint, not the paint the mask's art set. open_mask_object gets a doc
comment.
A dictionary's state starts afresh, with a black fill. Mask art is written
going on from the paint before the mask's dictionary, which the writer leaves
out when it doesn't change, so a mask rectangle with no colour of its own
came in black and hid the white letters it masks. Mask art now starts from
the paint (fill, stroke, line style, fill rule, overprint) before the
dictionaries it is in; lock, visibility and transparency still start afresh.
A pattern's definition (in either form) and a brush's art were read
without the file's art styles, so an object there with a style came in
as the look it draws, with a "drawn look" note, while the same object on
a layer or in a symbol came in as itself with its effects live. The
three definition readers now take the art styles as the symbol reader
does, and an object in a pattern's art with a style in the file's style
list keeps that graphic style's id.
An art styles section inside a symbol's, a pattern's or a brush's art
is now skipped, so it no longer replaces the file's own art styles.
The editing-data writer wrote a run's key 35 only for Tate-chu-yoko (3).
Type with Standard Vertical Roman Alignment, on or off, was saved with no
key, so the setting was lost from the editing data. Every run now carries
key 35 in the form the reader reads it (crates/eps/src/import/ate.rs,
Texts::style, lines 669-670): 1 when the setting is on, 2 when it is off
and 3 for Tate-chu-yoko. The document's defaults and the normal character
style carry 1.
Key 35 holds one value, so a run with both Tate-chu-yoko and the setting
is written as Tate-chu-yoko, and the save reports the type attributes
warning for it.
- writer/texts.rs: baseline_direction() gives each run's value;
normal_char() writes 1; loses() and TYPE_ATTRIBUTES name the setting.
- tests.rs: a vertical and a horizontal object with the setting on, off
and Tate-chu-yoko come back the same through the reader, lay out as
before, and carry the expected keys; a run with both is reported.
- docs/file-format-parity.md: the .ai save section lists the written
values.
swatch.new stored a gradient or pattern as it was given. A gradient
swatch made from a gradient swatch by name, from a fill linked to one,
or from a gradient that names one (the Gradient panel's add to
swatches) kept the link to that swatch, so copying art that uses the
new swatch brought the other swatch along too. A pattern swatch made
from a current fill picked up from art with transformed tiles kept
that transform, and art the swatch was applied to took it in place of
its own.
The new swatch now drops the gradient's link and stores the pattern
untransformed. A gradient swatch keeps its aspect as before.
The editing-data reader set the paint of each gradient swatch in the
palette to link to the swatch's own name. The default gradient swatches
and a gradient swatch given a new gradient with swatch.edit hold their
gradient without a link, so a document saved as .ai and opened again
had swatches that differed from the ones it was saved with. The swatch
now holds the gradient alone. Art filled with the gradient is not
changed: it still links to a swatch by the gradient's name.
The fix also applies to a .ai whose layers are not read, such as a
gradient library, where only the palette comes in.
Three tests cover a hand-written palette with a gradient swatch named
by its gradient and one with a name of its own, a new document's four
gradient swatches written by the editing-data writer and read back, and
a gradient library without layers.
dialogs::tests::workspace_and_toolbar_dialogs_end_at_their_buttons now
requires the gap between OK and the bottom of the window to be 0 to 40 pt,
so an OK drawn past the window's bottom edge fails. It requires exactly one
OK inside the window, and in New Workspace and New Toolbar exactly one
Cancel on OK's row to its left; the two Manage dialogs have no Cancel. It
also requires the gap between OK and the nearest shape drawn above it to be
under 40 pt.
The modern type reader read key 35 of a character style only for
Tate-chu-yoko (3). A run whose key 35 is 1 (Standard), in the run, its
character style or the document's defaults, now opens with Standard
Vertical Roman Alignment on, so its half-width characters stand upright
in vertical type. Horizontal type keeps the mark with no change to its
layout. A value of 2 (rotated), 3, any other value and no key at all
leave it off, VectorCraft's default.
- ate.rs: Style reads the flag and passes it to CharStyle, with a unit
test over defaults, character styles, run overrides and bad values.
- tests_native.rs: a vertical and a horizontal story with Standard,
rotated and unset runs; the test of values the reader ignores also
checks the flag.
- import_fuzz.rs: the vertical fixture also checks the flag.
- docs/file-format-parity.md: one line on the mapping.
Escape and Cmd+Enter (Ctrl+Enter on Windows and Linux) end text editing
and switch back to the tool that double-clicked into the type, or to the
Selection tool when there was none (`TypeTool::end_editing`). The
evidence lines in docs/type-parity.md, docs/ui-parity.md and
docs/target-app-parity.md, and the doc comments on `prev_tool` and
`claims_key`, said they always switch to the Selection tool.
The legacy .ai writer gives the type attributes warning when a text
object loses something it cannot hold. It did not give it for several
attributes that it does not write:
- Align to Path set to Ascender, Descender or Center.
- An end bracket before the end of an open path, or short of once
around a closed path. A legacy text path holds the path and the start
point only (AI7 File Format Specification, section 15).
- Manual kerning other than 0, which is written as kerning off, and
optical kerning.
- Optical Margin Alignment, System Layout and fractional widths off.
- A second subpath in an area type frame or a type path. The writer
writes the first subpath only.
The warning now names each of these.
SVG viewers center each <textPath> glyph on its midpoint on the path and
turn it to follow the path, which is how the Rainbow effect draws. Type on
a path with any other effect and no spacing was written as a plain
<textPath>, so a viewer drew it as Rainbow. It is now written as outlines
with a warning, as type with an end bracket, Align to Path or Spacing
already is.
Docs: docs/mcp.md, docs/target-app-parity.md.