Commit Graph
19427 Commits
Author SHA1 Message Date
dotCooCoo 3d460c1697 Scripts: guide, layer, move and addDocument fixes for the object model
- Document.selection and PageItem.selected refuse a path made into a
  guide while Lock Guides is on, instead of passing the check and then
  selecting nothing. The locked artboards are measured once per
  assignment.
- An edit whose command selects the objects it changes puts the current
  layer and the highlighted Layers panel rows back as they were.
  layer.setCurrent takes keepRows, which leaves the highlighted rows as
  they are.
- move on an object on a locked artboard throws Cannot move, as editable
  reads false for it. duplicate, with or without a relative object, on a
  hidden or locked object or an object on a locked artboard throws
  Cannot duplicate and makes no copy.
- When move takes the last path out of a compound path, the empty
  compound path is deleted in the same undo step.
- addDocument writes each warning from reading the profile's file to the
  Script Console as addDocument: <warning>, and a previewMode of
  PixelPreview throws an error that says it is not available yet.
2026-11-22 15:33:08 -08:00
dotCooCoo e48b811707 Scripts: an opacity a graph mark already has replaces the one its series keeps
Assigning PageItem.opacity skipped object.setProps when the item already
had that opacity, so a graph mark or label set to the opacity it shows
left the graph keeping the opacity another mark of its series or kind had
set. The setter now leaves the no-op check to object.setProps, as the
command does for that case. A value within the getter's rounding of the
item's opacity sends the opacity the item has, so assigning the opacity a
script read back still changes nothing and adds no undo step.
2026-11-22 07:02:06 -08:00
dotCooCoo b6bb1329cd New Document: choosing the selected Grid by Column keeps a preset's rows
Clicking the layout that is already selected removed the rows of a preset
made with file.new's rows and kept only the columns they showed, so Create
put a different number of artboards in each column. With five artboards
and rows 4, the first column got three artboards instead of four. A
different layout or a new column count still replaces the rows.
2026-11-22 05:58:20 -08:00
dotCooCoo 341f764458 Scripts: editable is false on a locked artboard, page item lists kept for several documents
- PageItem.editable is false for art on a locked artboard, as remove()
  refuses it. A group on a locked artboard is measured once for all its
  members.
- The lists of page items are kept for the last four documents read, so
  a script that reads two documents in turn does not walk each one again
  on every index.
2026-11-22 03:26:18 -08:00
dotCooCoo 67633efb4d Scripts: a linked profile file is refused and preset values count as passed data
A New Document profile file that is a link or a folder is no longer read:
the read is exempt from a script's file gate, which never checked where a
link leads. file.new reports it as a profileError with the reason "not a
plain file".

Reading a DocumentPreset setting now counts the value it returns toward
the data a run may pass, as assigning it does, and addDocument counts the
preset's settings before copying them.

The removeAll() test on a locked artboard now also holds an object on an
unlocked artboard and checks it is still there after the call throws.
2026-11-21 21:36:54 -08:00
dotCooCoo 71aaa752a0 New Document: a new layout keeps the columns a preset's rows showed
A preset made with file.new's rows under gridByColumn shows the column
count those rows give the current number of artboards. Changing the
Layout field removed the rows and kept the preset's stored columns, so
Create laid out a different number of columns than the dialog showed.
The layout change now writes the shown count into columns, for rows
stored as integers or floats. Under gridByRow the dialog shows the
stored columns and file.new rejects rows, so a layout change from it
keeps the stored columns, as it does for rows file.new would reject.
2026-11-21 19:52:56 -08:00
dotCooCoo abe8b303de Scripts: remove and removeAll keep art on a locked artboard
PageItem.remove() and PageItems.removeAll() checked only whether the
object and its layers and groups were shown and unlocked, then passed the
ids to edit.clear, which deletes named objects without checking artboard
locks. Both now throw "cannot delete objects on a locked artboard" with
the object ids and delete nothing, as art on a locked artboard is not
editable elsewhere in the document.
2026-11-21 18:14:01 -08:00
dotCooCoo e15e3e083d New Document: Columns reads float rows and columns as file.new does
The dialog read artboardLayout's rows and columns as whole numbers only,
so a value stored as a float (4.0 from ui.dialog.set) fell back to the
stored columns while file.new made the grid from it. The dialog now reads
both as file.new does: a number of 1 or more, rounded and kept to the
artboard limit.
2026-11-21 17:35:17 -08:00
dotCooCoo 5cb6480258 Scripts: assigning PageItem.selected keeps how the other objects are selected
Setting selected to true or false runs select.add or select.toggle for that one object, so the
other objects keep their direct-selected anchors and segments and the key object. Before, it
replaced the selection with whole objects.
2026-11-21 14:53:28 -08:00
dotCooCoo ba0441c458 Scripts: addDocument takes only a DocumentPreset and throws when its profile cannot be read
- new DocumentPreset() now makes an object of the DocumentPreset class whose settings the run
  keeps, so addDocument refuses a plain object, one with a typename of DocumentPreset included,
  with a TypeError naming presetSettings.
- When file.new reports a profileError, addDocument throws an error that names the profile and
  the reason, and the document made with the defaults is put back.
- A script's file.new reads the New Document profile file in the app's own profiles folder;
  the automation roots in force still apply. Before, the script's file gate refused the folder,
  so a scripted addDocument never used an edited profile.

Docs: docs/mcp.md.
2026-11-21 14:33:43 -08:00
dotCooCoo f33e0cb16d Scripts: PageItem.remove refuses hidden or locked art as removeAll does
remove() on an object that is hidden or locked, sits in a hidden or locked layer or group, or is a group holding such an object now throws and deletes nothing, the same rule pageItems.removeAll() applies. docs/mcp.md states both rules and that width and height scale along the page's axes.
2026-11-21 12:37:34 -08:00
dotCooCoo 76aee609f1 Tests: page item width and height setters give the page-aligned size on rotated objects
A rotated rectangle given a width and then a height through the scripting object model reads back the values set, its geometric bounds have that size, and other objects stay as they were. The resize doc comment names the page's axes.
2026-11-21 12:21:32 -08:00
dotCooCoo a8d1b29766 Tests: the script corpus failure test reads an undefined name
Scripts now have an app object, so app.activeDocument no longer throws a
ReferenceError. The test reads a name the host does not define instead.
2026-11-21 11:46:08 -08:00
dotCooCoo 4bc1f7a187 Scripts: Documents.add takes the artboard spacing file.new takes
artboardSpacing is refused above 100,000 points, the limit file.new
applies, so a value file.new would refuse throws a RangeError that names
artboardSpacing.
2026-11-21 11:40:55 -08:00
dotCooCoo 4b97cc8492 Scripts: a failed selection restore ends the run unless the command refused
When an edit puts the selection back, the Layers panel target, symbol part,
Objects on Path member, ruler guide and key object commands fall back or
skip only when the command refuses with an ordinary error. An internal
failure or a request to stop now ends the run instead of being treated as
a refusal.
2026-11-21 11:18:44 -08:00
dotCooCoo 626d843520 Scripts: list the object model in the host name check, refuse zOrder inside a compound path
The host name test now has rows for app, the document model classes and the enumerations the script host adds. zOrder on a path inside a compound path throws an error and leaves the document unchanged, as duplicate does.
2026-11-21 10:34:09 -08:00
dotCooCoo 6cce980e2b Scripts: keep targets and chosen parts when edits restore the selection
- An edit a script makes puts back a Layers panel target, an object
  chosen inside a dynamic symbol instance and an object chosen in an
  Objects on Path group, each with its own selection command.
- Assigning a document's selection selects a symbol instance or an
  Objects on Path group as a whole when one of its objects was chosen.
- file.newPresets lists a grid by column's rows as set, also when there
  are fewer artboards than rows, and New Document's Columns shows the
  columns those rows give the current number of artboards.
- docs/roadmap.md's M13 row names the script object model that is
  available.
2026-11-21 09:46:14 -08:00
dotCooCoo f70d2ee7e6 Scripts: duplicate, selection and wrapper fixes for the object model
- duplicate() runs Edit > Duplicate, the place and the selection
  restore under one savepoint, so a refused place leaves the documents,
  the selection and the undo history as they were. It reads the copy's
  id from the command's own result, so ids above 2^53 return the copy.
  A path inside a compound path throws an error instead of copying the
  whole compound path.
- An edit restores a mixed selection (direct-selected anchors and whole
  objects) in its original order with one select.anchorsMany.
- Assigning the selection clears a Layers panel target.
- A call on an inactive document switches back even when the selection
  restore fails.
- documents.add with a grid by column passes the row count to file.new,
  which takes a new artboardLayout.rows key: 5 artboards in 4 rows give
  columns of 4 and 1. A preset keeps the rows until columns without
  rows, or another layout, is given, and New Document drops them when
  Columns or the layout changes.
- A held page item stays the same object when its class changes in the
  same family (a placed image that is embedded becomes a RasterItem).
- A waiting class member's answer is read as a class instance, and a
  class constructor called with new cannot wait.

Docs: docs/mcp.md (DocumentPreset, duplicate, file.new rows), docs/gaps.md
(G6).
2026-11-21 08:43:10 -08:00
dotCooCoo f2d3b09fe6 Scripts: app, documents, selection and page items for scripts
Scripts get an app object with its documents, the active document and its
selection, and the page items of a document, read and edited through
commands so each edit is one undo step and is journaled. Host classes in
the JavaScript engine give each document or item one object while a script
holds it, answer `in` and indexed reads, and throw on stale objects and on
members that are not available yet.

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-21 05:13:46 -08:00
BFlat 9fff48d88f Merge pull request #8910 from dotCooCoo/fix/similar-fonts-thai-scan
Type: the font scan tells whether a family sets Thai as loading it does
2026-11-21 11:03:21 +07:00
BFlat f593dff00c Merge pull request #8903 from dotCooCoo/fix/plugins-folder-special-files
Plug-ins: the plug-ins folder can't block startup on a special file
2026-11-21 11:02:50 +07:00
BFlat 93388d642f Merge pull request #8887 from dotCooCoo/fix/tangent-circle-close-contacts
Path Precision Tools: the Tangent Circle Tool finds both circles where two second segments touch close together
2026-11-21 11:02:18 +07:00
BFlat 4ce43b1091 Merge pull request #8532 from dotCooCoo/feat/distorted-image-commands
Links: Relink, Embed and Unembed keep a distorted image's corners
2026-11-21 11:01:53 +07:00
BFlat ddcefb86c9 Merge pull request #8918 from storytold/train/carry8875
Path Precision Tools: the Tangent Circle Tool leaves out a circle that would reach past the canvas (#8875)
2026-11-21 11:00:19 +07:00
BFlat 5b52369187 Merge pull request #8919 from storytold/train/carry8873
Dimension: pointer moves read a compound path's members once per revision (#8873)
2026-11-21 10:58:44 +07:00
BFlat 1a1a939bdf Merge pull request #8858 from dotCooCoo/fix/style-redefine-series-own-links
Graphic Styles: Redefine Graphic Style keeps the own style of a path inside a series group linked to the target
2026-11-21 10:56:45 +07:00
BFlat 9078e13d78 Merge pull request #8867 from dotCooCoo/perf/selection-widgets-kind-first
Selection: on-canvas widgets check an object's kind before its editability
2026-11-21 10:56:16 +07:00
bflatastic 3bda231dd6 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/target-app-parity.md
2026-11-21 10:46:25 +07:00
bflatastic 8daaa2995b Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	crates/tools/src/dimension.rs
2026-11-21 10:43:59 +07:00
BFlat 96726b1f41 Merge pull request #8837 from dotCooCoo/fix/live-paint-contents-group-targets
Live Paint: graphic styles on a group's contents give fills to its faces and strokes to its edges
2026-11-21 10:39:37 +07:00
BFlat d77b6d9309 Merge pull request #8870 from dotCooCoo/fix/dimension-guide-member-holder
Dimension: a guide member of a compound path does not hold a preview-bounds corner
2026-11-21 10:39:09 +07:00
BFlat 54f256f666 Merge pull request #8634 from dotCooCoo/fix/select-widget-drags-settle
Selection: widget drags read the release point and a tool switch cancels them
2026-11-21 10:38:43 +07:00
BFlat f558297963 Merge pull request #8681 from dotCooCoo/feat/retype-near-matches
Retype: near matches within a tolerance, and words outlined as one compound path
2026-11-21 10:38:18 +07:00
BFlat 911177c775 Merge pull request #8874 from dotCooCoo/docs/3d-shadow-expands-blurred-as-image
Docs: a blurred 3D shadow expands to an image
2026-11-21 10:37:51 +07:00
BFlat 53fe391488 Merge pull request #8865 from dotCooCoo/fix/palette-typo-order-docs
Command Palette: docs order typo matches by the field the word is met in
2026-11-21 10:37:26 +07:00
BFlat 193f110ebe Merge pull request #8864 from dotCooCoo/fix/relink-edited-mask-docs
Docs: Relink and Update Links keep a clipping mask edited in the document
2026-11-21 10:37:02 +07:00
BFlat de11798f93 Merge pull request #8892 from dotCooCoo/fix/kinsoku-paste-relayout-test
Kinsoku sets: tests for pasted type and shaped lines under a custom set
2026-11-21 10:36:41 +07:00
BFlat 43e0407cd0 Merge pull request #8891 from dotCooCoo/fix/eraser-drag-midpoint-tip
Eraser: a drag's outline takes the tip halfway along each step in two more cases
2026-11-21 10:36:19 +07:00
BFlat 6aaef5ad68 Merge pull request #8886 from dotCooCoo/fix/outline-compound-strokes-not-fill
Pathfinder: Outline of a compound shape with no fill adds no stroke of its own
2026-11-21 10:35:55 +07:00
BFlat 7945ef5c86 Merge pull request #8884 from dotCooCoo/fix/safe-mode-expand-symbol-art
Expand Appearance: Safe Mode checks symbol art that a group's raster effect draws
2026-11-21 10:35:31 +07:00
BFlat f39e3e06cf Merge pull request #8871 from dotCooCoo/feat/draw-behind-place-symbol
Symbols: in Draw Behind a placed instance goes directly below the selection
2026-11-21 10:35:08 +07:00
BFlat ada693c03c Merge pull request #8868 from dotCooCoo/perf/legacy-ai-gradient-index
Legacy .ai: gradient definitions are found by a key of their gradient
2026-11-21 10:34:44 +07:00
BFlat c86bb07a44 Merge pull request #8854 from dotCooCoo/fix/confined-single-pdf-test-artboards
Tests: a confined single-file PDF of several artboards checks every artboard it carries
2026-11-21 10:34:16 +07:00
BFlat e8b23c5ba9 Merge pull request #8852 from dotCooCoo/fix/mesh-picks-survive-tool-switch
Mesh: picked points stay picked between the mesh-point tools
2026-11-21 10:33:52 +07:00
BFlat a5f9966ca5 Merge pull request #8861 from dotCooCoo/feat/freeform-lines-leave-ends-line
Gradient: moving out of a freeform object ends the Lines mode line
2026-11-21 10:33:27 +07:00
BFlat 4c0edd8844 Merge pull request #8904 from dotCooCoo/feat/script-check-host-classes
Script checker: setting a File's length, hidden or readonly counts as a file write
2026-11-21 10:32:19 +07:00
BFlat 9704f52fc8 Merge pull request #8812 from dotCooCoo/fix/shape-tools-smart-guide-labels
Shape tools: the Smart Guide label of a hover goes when the pointer leaves the canvas
2026-11-21 10:31:04 +07:00
dotCooCoo 0b5620cf78 Type: the font scan tells whether a family sets Thai as loading it does
The system font scan built each face from its name, fvar, OS/2, head and
post tables only, so a family that was found but not loaded never had
Thai in its traits. The font menus' Thai filter left such families out,
and Show Similar Fonts grouped them with the other scripts until they
were loaded.

- A face sets Thai when its OS/2 table allows it (no OS/2 table, the
  Thai Unicode range, bit 24, or the Thai code page, bit 16) and its
  character map has Thai, loaded or scanned.
- The scan reads the cmap table of such a face only, up to 16 MiB.
  The search for a document's missing fonts reads no cmap table, so
  its byte limit covers the same tables as before.
2026-11-20 19:25:52 -08:00
BFlat 83d6c2133c Merge pull request #8876 from dotCooCoo/fix/single-line-composer-geometry-tests
Type: tests check where the Single-line Composer sets lines around text wrap
2026-11-21 10:19:16 +07:00
BFlat 3f5531a7d3 Merge pull request #8881 from dotCooCoo/fix/dimension-first-pick-link
Dimension: a first Linear point keeps its link when the art moves before the second click
2026-11-21 10:18:42 +07:00