Commit Graph
2110 Commits
Author SHA1 Message Date
dotCooCoo c24c06ef7f Direct Selection: a marquee over a long path tests its segments without building a path for each
The marquee's segment test built a two-anchor path for every segment and ran
hit::intersects_rect on it. It now skips a segment whose anchors and handles
all lie past one side of the marquee, and tests the rest directly with the same
bounds and edge checks, so it selects the same segments.

A marquee over 10,000 anchors, press to release (anchor_bench, median of 7):
one open path of 200,000 anchors 84.9 ms -> 24.1 ms, 2,000 closed paths of 50
anchors 27.5 ms -> 13.5 ms, one closed path of 50,000 anchors 14.6 ms -> 8.5 ms.
2026-11-04 18:28:47 +07:00
dotCooCoo f0f19077df Document Color Mode: convert reusable paints and restore them with Undo
Squashed from #4517 onto main.
2026-11-04 16:55:43 +07:00
dotCooCoo 3fbdf72231 Docs: the long-stroke line names the strokes of path objects 2026-11-04 16:55:30 +07:00
dotCooCoo 676cc0ee8e Render: a long stroke is outlined only near the view after an edit
The renderer outlined the whole stroke of an edited path on every frame,
so dragging one anchor of a path with many anchors re-outlined every
segment. A stroke line of more than 1,024 elements without dashes or a
width profile is now outlined only for the segments within the stroke's
reach of the view, inflated by the view's own size on each side. The
cached outline keeps that region, and a frame outside it outlines the
stroke again. Closed subpaths that a wide stroke crosses over stay whole,
and a cut closed subpath is walked from a removed segment so no cut lands
where it starts and ends. The pixels are the same.

At 1600 x 1200, the frame after one anchor moves takes 28 to 30 ms
instead of 103 ms on an open path of 200,000 anchors, and 10 ms instead
of 30 ms on a closed path of 50,000 anchors (the new anchor_bench
example: cargo run --release -p vectorcraft-engine --example anchor_bench).
2026-11-04 16:55:30 +07:00
dotCooCoo e3a55b97fd Type: Text Tweaker leaves byte offsets to range_of
Remove Text Tweaker's own start and end check: range_of already refuses
a bad offset given with an id, and like the other type commands Text
Tweaker now ignores start and end without one. The test's "2" case
gets an id so it still reaches the check, and docs/mcp.md lists
addon.type.textTweaker with the commands that refuse such offsets.
2026-11-04 16:55:22 +07:00
dotCooCoo 595db10900 Type: refuse negative or fractional byte offsets in text commands
text.startList read a negative or fractional `at` as the end of the
text, so it could remove a typed list marker there and start a list.
The `start` and `end` of text.editRange, text.getRange,
text.setRangeStyle and the type shortcut commands given an `id` read
such values as the start or end of the text.

These now return "`at` must be a whole number" (naming the key) and
change nothing. Omitted or null keys keep their defaults, and 2.0 is
read as 2.
2026-11-04 16:55:22 +07:00
dotCooCoo a7acf43cb1 .ai import: objects come in bound to their variables
Squashed from #5481 onto main.
2026-11-04 16:33:25 +07:00
dotCooCoo 322f1c24db .ai import: brushes come in from the editing data
Squashed from #5046 onto main.
2026-11-04 15:41:24 +07:00
dotCooCoo f4469e16d6 Control bar: the Global Edit Options dropdown shows while Start Global Edit can run
While Select > Start Global Edit can run, the Control bar shows a Global Edit
Options dropdown after Recolor Artwork. It opens the Properties panel's Global
Edit Options (Match: Appearance, Size; On Artboards; Include Objects On
Canvas; Result(s)), so both set the same options, and it is off while Global
Edit is on, as the Properties dropdown is. The bar leaves it out when no room
is left for it.

Public reference:
https://helpx.adobe.com/illustrator/desktop/manage-objects/edit-objects/edit-similar-objects.html

The dropdown takes room ahead of the inline X/Y/W/H fields, so the ruler-origin
tests that read X/Y from the Control bar draw it 1700 px wide.
2026-11-04 15:41:15 +07:00
dotCooCoo a8c6d078e5 .ai import: blends keep their Specified Distance and Smooth Color spacing
A blend's record in the editing data holds its Blend Options spacing.
Word 1 is the spacing: 0 is Smooth Color, 1 is Specified Steps and 2 is
Specified Distance. For Specified Distance, word 2 is the distance in
points as a 32-bit float. The reader took only records whose word 1 is
1, so every Smooth Color and Specified Distance blend came in as its
drawn steps.

A Smooth Color or Specified Distance blend now opens live with that
spacing where VectorCraft lays out as many steps between each pair of
keys as the file draws, in the same places and colors. Otherwise it
keeps its drawn steps with the existing note. The distance is read as
the shortest decimal that reads back as the stored float. The steps are
counted before anything is laid out, and a blend takes from the
import's budget only when its count matches. Specified Steps blends
are read as before, with the steps counted from the drawn ones.

Tests: import::ai::tests::a_blend_keeps_its_spacing,
a_blend_of_three_keys_keeps_its_distance_between_each_pair,
a_blend_whose_spacing_doesnt_lay_out_its_steps_keeps_them,
import::ai::blend::tests::records_say_their_spacing,
a_blend_takes_from_the_budget_only_when_it_is_laid_out,
a_distance_past_the_keys_lays_out_no_steps, and the fuzz case
ai_blend_spacing_never_panics.
2026-11-04 15:41:08 +07:00
dotCooCoo 146d30502a Expand: selected symbol instances become their art, as Break Link places it
Object > Expand with Object on now turns each symbol instance in the
selection, including one in a selected group or in a placed document's
art, into its art, as Break Link to Symbol places it. It goes one level
deep: the instances in that art stay instances. The art keeps the
instance's id and place in the stacking order, and Expand stays one
undo step.

- Instances with effects stay instances, and Expand Appearance bakes
  them as before. Instances with an effect on a fill or stroke,
  instances in perspective, and those in blends, repeats and Intertwine
  groups stay instances.
- The art keeps the instance's opacity mask, as Break Link gives it.
- A hidden or locked instance's art stays hidden or locked.
- A placed document in an instance's art is expanded too.
- When the instances' art would make more than 1,000,000 objects, they
  stay instances, the limit Break Link uses.
- The Fill and Stroke options (object.expand.info, and the Expand
  dialog) count the fills, strokes and gradients in the art of those
  instances, with a dynamic instance's own changes applied. The info
  reports under symbolArt which of them only that art holds, and the
  dialog enables those options only while Object is on.
2026-11-04 15:14:02 +07:00
dotCooCoo a79ab62712 Select: Same Symbol Instance takes its reference from an object that can be selected
Squashed from #5511 onto main.
2026-11-04 15:13:32 +07:00
dotCooCoo 92640179e5 Type: Select All in a threaded frame selects the whole story
While the Type tool edits a frame of threaded text, Select All selects
the text of every frame of the story, highlighted in each frame. The
tool edits the first frame that holds text.

- Typing, Delete and Cut replace the whole story as one undo step
  (`text.editRange` takes `clear`, the other frames whose text goes).
- Copy and Cut take the whole story (`text.getRange {id, story: true}`).
- Fills and strokes, `type.step`, `appearance.copyFrom`, the Character,
  Paragraph, OpenType and text style panels, the Tabs panel's tab
  stops, the font menus and the Justification dialog act on every
  frame's text (`text.setRangeStyle {id, story: true}` styles them in
  one edit).
- A caret move, a click or a word or paragraph selection ends it.

Select All in unthreaded type is unchanged.

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-04 15:13:20 +07:00
dotCooCoo 4aa8a8b0c8 Layers: Template always locks the layer in Layer Options
Template sets Lock again even when Lock was set in the dialog before it,
so a template layer is always locked. Only a Dim Images set before
Template keeps its value.
2026-11-04 14:56:41 +07:00
dotCooCoo 2ac1fa4cce Layers: Layer Options keeps a Lock or Dim Images that was set before Template changes
Setting Template in the dialog (the checkbox, or ui.dialog.set of template)
also set Lock and Dim Images, replacing a value set in the dialog earlier.
That value was then sent to every selected row, and ui.dialog.set gave
different results depending on the order of its fields. A Lock or Dim Images
set in the dialog now keeps its value when Template changes.
2026-11-04 14:56:41 +07:00
dotCooCoo e5834f7686 .ai import: the layers are compared with every page of a multi-artboard file
A .ai file whose PDF part has a page for each artboard had its layers
compared with the first page only. Art that the layers drew on a later
artboard and its page didn't, or that a later page drew and the layers
didn't, opened from the layers with no warning, and a text object that a
later page doesn't draw stayed.

When the PDF part has a page for every artboard, each page is now
compared with the layers on its artboard, and the comparison fails when
any page differs by more than it allows. Text objects that a later page
doesn't draw are weighed there and left out, unless their layer doesn't
print. Art that differs on a later page is handled as on the first page:
such files now open from their PDF part with the usual warning, where
they opened from their layers before. A PDF part with pages for some of
the artboards, or with its pages cropped to the art, is still compared
on its first page only. Pages are compared until their comparison
drawings take 8,388,608 pixels (about 67 letter-size pages, or 4 when the
PDF part is only images), and at most 128 pages are compared. The type
share in the import's note is now that of the page whose type differs
most.

The layers are drawn once for the pages of the same size and cut into
each page's part. Each page moves by less than half a pixel to start on
a whole pixel, and the column or row the move takes past its artboard
isn't compared. Each page's drawing and result are kept until the layers
change, for the last two documents weighed. Taking a text object out
draws again only the pages within reach of it (every page when type
wraps).

An artboard, or the page of an EPS's editing data, whose sides are within
half a point of its page's is drawn on an area of the page's size, so
both drawings have the same number of pixels. Before, such a file could
open without its layers when the half point changed the rounded size of
its drawing, even when its layers matched the page.

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-04 14:56:38 +07:00
dotCooCoo b9d3881872 Docs: state the stop limit for Perceptual spot gradient shadings
PDF export writes a Perceptual spot gradient as a Separation or DeviceN shading only when its expanded curve has at most 4,096 stops (MAX_INK_TINTS in crates/color/src/gradient.rs). Longer curves are written as images, with the process-color warning.
2026-11-04 14:56:35 +07:00
dotCooCoo 3bd1514acb Type: offer stylistic sets only for an installed font, by their own names
A font that is not installed offered the sets of the face drawn in its place; the menu now offers none. Set names the font supplies are shown as they are, without UI translation.
2026-11-04 14:09:34 +07:00
dotCooCoo 1858da4106 Type: use selected font version for stylistic sets 2026-11-04 14:08:30 +07:00
dotCooCoo b72c822f1d Add font-aware OpenType stylistic sets menu 2026-11-04 14:08:30 +07:00
dotCooCoo d46079b872 Docs: name glows with shadows in the pan raster entry, and mark VectorCraft's own values
The panning entry says a Drop Shadow or Outer Glow raster holds the
shadow or glow of group members outside the view. The Blob Brush
Fidelity entry keeps its citation on the option and states that the
slider and field range and the 1.5 pt default are VectorCraft's own
values. The Escape in Selection tool drags entry is stated as
VectorCraft's own behavior.
2026-11-04 14:08:26 +07:00
dotCooCoo f7bebdeaf0 Live Paint: preserve face colors at shared curved boundaries
Capture sweep-piece source attribution before endpoint pinning can move its
midpoint off the original outlines. Keep the existing lookup after pinning
when the original piece has no source.

Add planar coverage and native compound Make/Expand/undo regressions, and
document the existing front-most source-fill rule.
2026-11-04 14:08:23 +07:00
dotCooCoo 251cc964a5 Actions: exclude recorded steps from playback
Squashed from #5422 onto main.
2026-11-04 13:42:33 +07:00
dotCooCoo a35f3a0fee Docs: cite where a group's or layer's effect comes from in the .ai look copies entry
The evidence entry for type in copies that a layer's or group's drawn look
draws now cites the help page that describes effects on a group or a layer,
and says that matching the page's type with a copy is VectorCraft's own rule.
2026-11-04 13:16:20 +07:00
dotCooCoo 6cbfb83c65 Select: Same commands take their reference from an object that can be selected
Select > Same > Fill Color, Stroke Color, Fill & Stroke, Stroke Weight,
Opacity, Blending Mode, Appearance, Shape, Graphic Style and Appearance
Attribute compared the other objects with the first selected object,
even when select.set had put a hidden or locked object, one on a
template layer or one outside the isolated group first. They now take
the first selected object that the Select commands could select, in
selection order, and keep the compound path and isolation rules for it.
A selection that holds no such object returns "nothing selected".
2026-11-04 12:50:38 +07:00
dotCooCoo d9cfaf9041 MCP docs: vertical text uses vert alternates, and duplicate defaults to the current set
add_text's vertical option turns on the OpenType vert feature, so the docs no
longer say it leaves glyph orientation unchanged. ui.actionSet.duplicate uses
the current set when set is omitted, with or without action.
2026-11-04 12:50:33 +07:00
dotCooCoo c54c4567c7 Color controls: preserve working RGB components in numeric edits
Read RGB and HSB numbers in the active working RGB space in the Color panel
and Color Picker. Keep native values through hex and web-safe controls and
cache live components by native color and color settings.
2026-11-04 12:44:49 +07:00
dotCooCoo 5c224a0d08 Symbols: Break Link keeps the instance's opacity mask
Break Link to Symbol dropped the instance's opacity mask. The art now
keeps it, or a group around the art holds it when the symbol's art has
a mask of its own. The objects in the instance's mask art count against
Break Link's limit of 1,000,000 objects.
2026-11-04 12:44:46 +07:00
ruchirguitarandClaude Opus 5.5 bf58f605fe Text Tweaker: refuse ranges that aren't whole bytes, make no step when nothing changes (#4924)
A `start` or `end` such as -1 or 1.5 was read as absent and changed text
before the range; it is now refused. Characters that already have the value
are left out, so a run that changes nothing returns count 0 and makes no
undo step. docs/mcp.md cites the public formatting-type page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 12:44:44 +07:00
dotCooCoo 0dba3afea9 Docs: the 1 pt default stroke weight on type is in the type's own units
docs/mcp.md says that the default weight text.setStyle and text.setRangeStyle give an unweighted stroke is in the type's own units, so scaled type draws it wider, while strokeWidth and strokeOptions lengths are in document points.
2026-11-04 12:44:43 +07:00
dotCooCoo 79102f6104 Tests: range stroke weight test joins the character stroke tests
The test moves from an inline module in cmd/textedit.rs to
tests/charstroke.rs and uses that file's helpers. docs/mcp.md says that
text.setRangeStyle gives a range's stroke a 1 pt weight as text.setStyle
does, and that its strokeWidth and strokeOptions lengths are in document
points.
2026-11-04 12:44:42 +07:00
dotCooCoo 22c2e2c9bd .ai import: copies drawn by a layer's or group's look keep their type
When an effect on a layer or a group draws copies of its art, the editing
data holds the type of each copy inside the drawn look. The reader skipped
that type, so the copies came in without text objects, the page's type for
them was given to other groups by painting order, and the import noted that
a text object may be in another group than it was.

The reader now keeps such type as a text slot without a story, in the
copy's group. The page's type that lies over a copy's other art (at least
half of it in the art's box) goes to that copy's slots by painting order,
before the rest is given out. Of overlapping copies, the one that holds
more of it takes it, and the smaller one on a tie. When the page's type
outside the copies is too little for the other text objects, a copy with
more of the page's text objects than slots leaves the extra ones to them.
A slot that gets no type
is removed and not counted as a text object that couldn't be read.

Type beside a copy's art, and every copy's type in a file past the import's
text-object limits or opened with its type as outlines, goes as before. A
text object with an appearance keeps its own type as before.
2026-11-04 12:06:08 +07:00
dotCooCoo c8128ee65b Graphs: series marks keep a fill or stroke opacity when the graph is drawn again
A graph keeps the paint and stroke weight given to a series' marks, but not
the opacity of their fill or stroke row. An opacity set with
`transparency.set {item}` or `appearance.setItem {opacity}` on a column,
bar, line or other series path was lost the next time the graph was drawn
(a data, type or option change).

- `SeriesPaint` gains `fillOpacity` and `strokeOpacity`. A setItem opacity
  on the topmost fill or stroke of a series path stores it, in the same
  undo step, and the generator puts it on the topmost fill and stroke of
  every path directly in that series' group. Graph designs keep their own
  opacity. A value read from a file is held to 0..1.
- The Appearance commands that change the opacity of a series path's
  topmost fill or stroke (add, remove, duplicate and move a row, Clear
  Appearance, Reduce to Basic Appearance, `appearance.transfer` and the
  Eyedropper) update the stored opacity. They do not change the stored
  paint, which only `paint.setFill` and `paint.setStroke` set.
- An edit that leaves a series path fully opaque stores nothing for a
  series the graph keeps nothing for.
2026-11-04 11:45:16 +07:00
dotCooCoo 64b1fa5ab2 Docs: describe help-page behavior in our own words
Remove copied sentences from workspace, Actions, symbol and export notes.
Keep source links, command identifiers, UI labels and behavior rules.
2026-11-04 11:45:13 +07:00
dotCooCoo 83d9ed1ee2 Docs: keep removed Type core evidence in the kept row
The duplicate Type core rows carried evidence the kept row did not: recent-font groups (#3515), Fractional Widths per type object, color emoji bitmap fonts, and the threading ports clause (#2572) with its test names. Move it into the kept row's evidence cell.
2026-11-04 11:45:12 +07:00
dotCooCoo cc4b492ef1 docs(type): remove stale duplicate parity rows
Follow CodeRabbit review on VectorCraft #5436; retain one current Type core row per table and one target header.
2026-11-04 11:45:12 +07:00
dotCooCoo 782071d1c7 Docs: reconcile Kashidas and Type options parity 2026-11-04 11:45:11 +07:00
BFlat 15670ca9f3 Merge pull request #4968 from dotCooCoo/feat/ai-editing-data 2026-11-04 11:41:38 +07:00
dotCooCoo 5e4f0720b0 Layers: Layer Options for several rows sends only the settings set in it
With several rows highlighted, Layer Options shows the first row's
settings, and OK sent Show, Lock, Color, Template, Print, Preview and
Dim Images to layer.setProps for every row. Changing one setting gave
every row the first row's values for all of the others as well.

The dialog now records each setting set by one of its controls or by
ui.dialog.set, and for several rows OK sends only those. A setting set
to the value the dialog shows is still sent, so choosing the first row's
color gives every row that color.

When Template changes and Lock and Dim Images are not set in the dialog,
OK does not send them. layer.setProps then locks each row that becomes
a template and dims it to 50%, unless a percentage is set in the dialog,
and unlocks and stops dimming each row that stops being one. When
Template is turned on, the dialog shows that 50%. When Template is set
back to the first row's value, the dialog shows the first row's Lock,
Dim Images and percentage again. A Dim Images percentage set in the
dialog is sent whenever Dim Images is on, also when Template turned it
on.

ui.dialog.set of template now also sets locked and dimImages, as the
Template checkbox does, for one row as well as several. Before, a script
that set template to true and confirmed the dialog left the layer
unlocked and undimmed.

The Dim Images percentage field now has the accessible name "Dim Images
to:", as its checkbox has.
2026-11-04 10:51:43 +07:00
dotCooCoo 46bb91275d Merge main into feat/ai-editing-data 2026-11-03 19:47:02 -08:00
dotCooCoo de78142dd8 Toolbars: Manage Toolbars renames, copies and deletes the toolbars made with New Toolbar
Window › Toolbars › Manage Toolbars… and Manage Toolbars… in the All Tools
drawer's menu open a dialog that lists the toolbars made with New Toolbar.
A name typed for the selected toolbar renames it, + copies the selected
toolbar or, with none selected, makes a new one, and the trash can deletes
it (https://helpx.adobe.com/illustrator/using/tools.html, Manage toolbars).

VectorCraft's own details:
- A rename applies at Enter, when the text box loses focus, or at OK. The
  name follows New Toolbar's rules: not empty, at most 200 characters, and
  not another toolbar's in any case.
- A copy is called "<name> Copy" (then "<name> Copy 2"), shows a little
  below the toolbar it copies and below earlier copies; a new toolbar is
  called "Toolbar N".
- Each change applies at once; deleting also removes the groups torn off
  the toolbar.
- When the typed name is refused, a click on +, the trash can or another
  toolbar is not applied, so the name can be corrected. When the selected
  toolbar is deleted elsewhere while the dialog is open, none is selected.
- Renaming or deleting a toolbar closes the All Tools drawer and a group's
  flyout open on it; a change of case only leaves them open, and the Tools
  panel's flyouts and other toolbars' stay open.
- Each change shows under Window › Toolbars and is kept with the workspace.

New commands: window.toolbar.manage, window.toolbar.rename,
window.toolbar.duplicate and window.toolbar.delete, with catalog rows for
their labels in every language.

Docs: control-protocol.md, gaps.md, target-app-parity.md, ui-parity.md.

Part of #1759
2026-11-04 10:26:01 +07:00
Don Omondi 4f60ee47e8 Fix #2920: an open path in a PDF-compatible .ai opens as drawn
Squashed from #4616 onto main.
2026-11-04 10:25:55 +07:00
dotCooCoo b5c69e25fd Add command to begin recording Actions 2026-11-04 09:43:35 +07:00
dotCooCoo 5e495cf900 .ai import: objects that draw differently from the page come in as its art, and the layers stay
When the layers fail the comparison with the file's own page because some objects draw
differently (an object in another color, or one that only one side draws), the import finds
each top-level object whose bounds hold a patch of such pixels (the smallest one that holds it)
and replaces it with the page's art in its bounds, in the same way as an unread object. It then
compares the layers with the page again. When that comparison passes, the layers stay, and a
warning names the layer or sublayer of each replaced object (`<Layer>` for one without a name)
and how many were replaced on it. Like the warning for unread objects, this warning counts as
a loss, so an export or Save As to the file's own path needs `acknowledgeLoss: true`. A
replaced wrap object keeps its wrap options, and area type is wrapped again around the page's
art. Placed files at their other placement are tried too when the first placement can't be
kept.

The file still comes in as its PDF part, with the same reason, when only edges or type differ,
when a difference lies outside every top-level object, when more than half of the top-level
objects (or more than 64) hold one, when such an object is or holds type or holds a wrap object
inside a group, when the page's type of a text object that stays would be copied into a
replacement, when the page's art can't replace an object for the reasons it can't replace an
unread one, when matching the differences to the objects would take too much work, or when the
second comparison still fails. Trusting the editing data keeps the objects as read.
2026-11-04 09:43:28 +07:00
dotCooCoo 8cf4b90a65 Contextual Task Bar: type on a path offers Type on a Path Options
The task bar offered no Type on a Path item for a selected type on a
path: of the type actions, it showed only Create Outlines. It now also
offers Type on a Path Options, which opens the same dialog as Type ›
Type on a Path › Type on a Path Options, with the selected type's
effect, alignment and spacing filled in. Point and area type keep
their Convert To Area Type and Convert To Point Type buttons.
2026-11-04 09:43:25 +07:00
dotCooCoo 7fe42986c2 Select: the font Same commands take their reference from type that can be selected
Select > Same > Font Family, Font Family & Style, Font Family, Style & Size,
Font Size and the text fill and stroke color commands took the type to match
from the first type found among the selected objects. Type that is hidden or
locked inside a selected group, type on a template layer and type outside the
isolated group could set the reference. They now take it from the type that
Link Block Series starts from, in the same selection order. A selection whose
only type cannot be selected returns "select a text object".
2026-11-04 09:43:21 +07:00
dotCooCoo e3a6ec68fa Docs: describe the New Window source in our own words
The New Window line in docs/target-app-parity.md quoted the help page word for word. It now describes what the page says and keeps the link.
2026-11-04 08:13:58 +07:00
dotCooCoo e03665a215 Window: New Window opens a second view of the current document
Window > New Window was grayed out. It now opens another view of the
current document, with its own zoom, center, rotation, artboard and
Outline or Preview, as a tab of its own. While a document has more than
one view, each tab shows the view's number after the name
("Untitled-1:2"). An edit in one view shows in every view of the
document.

Tile, Cascade, Float in Window, Float All in Windows and Consolidate All
Windows arrange each view as they arrange a document, and Tile and
Cascade are enabled with two views of one document. A new view of a view
in a floating window opens in a floating window too. File > Close and a
tab's close button close the view; the document's last view closes the
document, asking to save it first. Next Document and Previous Document
step through the views in tab order.

Each Tile pane and floating window draws its view in its own Outline or
Preview, and switching views with the Artboard tool targets the artboard
the view shows. A switch to another view of the current document resets
the tool, as a switch to another document does (Session::reset_tool).
Artwork held over another view's tab during a drag switches to that
view, and a drop there moves it.

Fixes #4116
2026-11-04 08:13:58 +07:00
dotCooCoo 1246c62095 DXF: paths of lines and circular arcs export as polylines with bulges
A path made of straight segments and circular arcs (a slot, a D shape,
a rounded rectangle, a pie) was written as one SPLINE, or as a flattened
polyline in R12. It is now one polyline whose vertices carry a bulge
(group 42) for each arc: an LWPOLYLINE in R14 and later, a POLYLINE with
VERTEX entities in R12 and R13, closed when the path is closed. Each run
of cubics on one circle becomes one arc. A path with any other curve
stays a SPLINE, and whole circles, arcs and ellipses keep their CIRCLE,
ARC and ELLIPSE entities.

- The circle test's tolerance is 5e-4 of the smaller of the radius and
  the curve's extent, so a shallow curve that is not circular is no
  longer written as an ARC.
- The drawing extents take each ARC's and each bulge's furthest points.

Part of #1299
2026-11-04 08:12:52 +07:00
dotCooCoo 40175d90c7 Geometry: inverses and conjugates by small affines are no longer refused
A projection now counts as invertible when its determinant, or its
adjugate's determinant, is more than 1e-15 times the largest of the six
products that determinant sums. The adjugate of the adjugate is the map
times a number, so the inverse of a projection that inverts also inverts,
is stored and reads back. The adjugate's cofactors are formed with exact
products, so the inverse of that inverse gives back the original map up
to scale, within 1e-6 of each row's largest entry, and a map whose third
row is the sum of its first two is still refused.

Homography::conjugated and Node::transform_projection judged the affine
map by an absolute determinant of 1e-15, so a scale by 1e-8 left type and
symbol instances in perspective with their old projection. Both now use
Homography::affine_is_invertible, which compares the determinant with
the two products it sums at any scale of the map. An affine map whose
determinant or inverse is not finite, such as a scale by 1e200 or
1e-200, is inverted through Homography::inverse. When the direct product
underflows to a map that is not invertible, as for a projection stored
at a subnormal scale, conjugated forms it again with its powers of two
kept apart.

- crates/geom/src/projective.rs: the_inverse_of_an_invertible_map_is_invertible,
  conjugating_does_not_depend_on_the_scale_of_the_affine,
  conjugating_a_map_at_a_tiny_scale_gives_an_invertible_map
- crates/doc/src/node/tests.rs: a_projection_follows_the_transform_or_is_removed
  covers an invertible scale by 1e-8 and a singular map at that size
2026-11-04 08:12:48 +07:00