Commit Graph
794 Commits
Author SHA1 Message Date
dotCooCoo fa91b67756 Merge main into fix/tracing-mask-art 2026-12-04 07:40:12 -08:00
.CooCoo ef168fad05 Merge pull request #10665 from dotCooCoo/fix/remove-all-empty-compound-mask
Scripts: pathItems.removeAll cannot empty a compound path that clips other art
2026-12-04 06:56:17 -08:00
dotCooCoo 7304910e7b Merge main into fix/tracing-mask-art 2026-12-04 02:55:17 -08:00
dotCooCoo 12c1b211ec Merge main into fix/tracing-mask-art 2026-12-04 00:52:54 -08:00
dotCooCoo 62e09de5ac Merge main into fix/remove-all-empty-compound-mask 2026-12-04 00:43:34 -08:00
dotCooCoo c62ddb2b33 Merge main into fix/script-paths-locked-layer 2026-12-04 00:43:34 -08:00
dotCooCoo fa8d7dbe1d Merge main into fix/doc-pathitems-removeall-clipping 2026-12-03 11:43:15 -08:00
dotCooCoo 8245421df6 Merge main into fix/script-paths-locked-layer 2026-12-03 11:27:43 -08:00
.CooCoo 64a7515fea Merge pull request #9147 from dotCooCoo/feat/scripts-scriptui-palettes
Scripts: ScriptUI palettes stay open after the run and run their handlers in line
2026-12-03 11:24:20 -08:00
dotCooCoo 0ccb62fac4 Merge main into fix/tracing-mask-art 2026-12-03 11:08:41 -08:00
.CooCoo 6ec7bdd244 Merge pull request #10696 from dotCooCoo/fix/global-edit-stale-points
Scripts: path points of other Global Edit members go stale when Global Edit changes them
2026-12-03 10:46:39 -08:00
dotCooCoo d027865eea Merge main into fix/script-paths-locked-layer 2026-12-03 10:44:44 -08:00
dotCooCoo be47572304 Merge main into fix/doc-pathitems-removeall-clipping 2026-12-03 09:36:45 -08:00
dotCooCoo c4a737f255 Merge main into feat/scripts-scriptui-palettes 2026-12-03 09:29:28 -08:00
dotCooCoo 0a990cecd1 Merge main into fix/remove-all-empty-compound-mask 2026-12-03 09:04:30 -08:00
dotCooCoo 5ff65970f9 Merge main into fix/global-edit-stale-points 2026-12-03 08:56:53 -08:00
.CooCoo d91cf654b3 Merge pull request #10699 from dotCooCoo/fix/script-point-undo-selection
Scripts: undoing a point write selects the anchors it dropped again
2026-12-03 08:48:47 -08:00
.CooCoo dbacda04ee Merge pull request #10698 from dotCooCoo/fix/script-text-spot-color
Scripts: a text color assigned in a CMYK document is compared as the document stores it
2026-12-03 08:47:10 -08:00
dotCooCoo a857b49af4 Main: removeAll on a clipping path passes on a stale-point error
#10682 made paths::see_all_points return a Result; d22384d6 had added a call in the mask-release path of removeAll that ignored it, so clippy -D warnings fails on main. The call now passes the error on with ?, as the other three callers do.
2026-12-03 08:46:32 -08:00
.CooCoo fff1c92179 Merge pull request #10682 from dotCooCoo/fix/script-point-scan-charged
Scripts: the look for changed path points after each command is charged
2026-12-03 08:22:32 -08:00
dotCooCoo 96e3535c45 Merge main into fix/global-edit-stale-points 2026-12-03 07:45:26 -08:00
dotCooCoo 199b92bd5c Merge main into fix/doc-pathitems-removeall-clipping 2026-12-03 07:44:01 -08:00
.CooCoo fc19f5a42d Merge pull request #10664 from dotCooCoo/fix/action-playback-current-artboard
Scripts: doScript steps act on the artboard the script made active
2026-12-03 07:36:06 -08:00
.CooCoo a64c923e04 Merge pull request #10658 from dotCooCoo/fix/layer-selection-scans
Scripts: hasSelectedArtwork selects inside an isolated group and charges its scans
2026-12-03 07:35:25 -08:00
.CooCoo de71cfc9ef Merge pull request #10654 from dotCooCoo/fix/script-image-matrix-locks
Scripts: image matrix assignment refuses locked and hidden images
2026-12-03 07:34:43 -08:00
.CooCoo 6d2b626597 Merge pull request #10653 from dotCooCoo/fix/script-transform-stroke-limit-empty-path
Scripts: transforms keep path strokes within 1000 points and take empty paths
2026-12-03 07:34:28 -08:00
.CooCoo 06d4971200 Merge pull request #10648 from dotCooCoo/fix/dxf-unit-scale-ratio-percent
Scripts: ExportOptionsAutoCAD.unitScaleRatio is a percentage
2026-12-03 07:34:11 -08:00
.CooCoo 4ed98d68c1 Merge pull request #10645 from dotCooCoo/fix/legacy-tracing-first-sight
Scripts: tracings saved without their record catch artwork added before the script reaches them
2026-12-03 07:33:48 -08:00
.CooCoo 9a21dae940 Merge pull request #10636 from dotCooCoo/fix/script-image-read-once
Scripts: placing or relinking an image reads its file once
2026-12-03 07:32:03 -08:00
.CooCoo 79fdfedfb5 Merge pull request #9075 from dotCooCoo/feat/scripts-api-d8c-rasterize-capture
Scripts: Document.rasterize and Document.imageCapture with their option classes
2026-12-03 07:14:28 -08:00
dotCooCoo fc9d77032f Scripts: pathItems.removeAll counts a list marker as a clip outline
The document's pathItems.removeAll() skipped text whose characters are
all whitespace before laying it out, so a numbered paragraph holding a
single space did not count, although its number clips. The deletion was
then refused while the mask would still clip.

- Whitespace-only text is laid out like other text.
- Text is laid out only inside a mask that loses a path, so documents
  with text outside such masks do no layout for the check.
- A test covers a mask left with only a list number.
- docs/mcp.md says blank text without a list marker does not count.
2026-12-03 03:19:03 -08:00
dotCooCoo 4a1ac38ac3 Scripts: a Linux folder whose casefold flag can't be read is taken as casefolded
When the folder can't be opened or `FS_IOC_GETFLAGS` fails, `casefolded`
returned false, so `imageCapture` treated names that differ only in their
normalization form as two files and could write over a source document.
It now returns false only when the flags are read and the flag is clear.
2026-12-03 02:59:58 -08:00
dotCooCoo ade0e47f48 Scripts: refused writes create no file; Linux reads the casefold flag
A refused rename that falls back to copying into the target no longer
creates a missing target before the final authorization check. The
target is created only after that check, on every platform, so a
refusal at the final check leaves the path absent. An existing target
is still opened with O_CREAT, so Linux's fs.protected_regular applies.

imageCapture no longer treats an empty Linux folder as ignoring the
Unicode normalization form. It reads the folder's casefold inode flag
(FS_IOC_GETFLAGS) instead, so a missing linked cafe\u{301}.png no longer
matches cafe\u{e9}.png in an ordinary folder, and a casefolded folder
still matches both spellings.
2026-12-03 02:35:18 -08:00
dotCooCoo 4bbfb2d4af Scripts: pathItems.removeAll counts only type that draws glyphs as a clip outline
The document's pathItems.removeAll() counted any visible text object as
geometry that keeps a clipping mask clipping. Blank type and area type too
short for its first line lay out no glyphs, so the clip renderer clips by
nothing for them; deleting the mask's last path then hid the clipped art.

- Text counts only when it is visible and its layout gives glyph outlines.
- A clipping group nested in the mask counts only its first member.
- Hidden objects and members of hidden groups do not count.
- Tests cover blank, overset, hidden and nested-clipped type, and type
  with glyphs that still allows the delete.
- docs/mcp.md states the rule.
2026-12-03 02:17:57 -08:00
dotCooCoo 895b542409 Merge main into fix/remove-all-empty-compound-mask 2026-12-03 01:54:59 -08:00
dotCooCoo 0d9dfe6bb8 Merge main into fix/script-clipped-hidden-top 2026-12-03 01:54:05 -08:00
dotCooCoo 4ada69770b Scripts: pathItems.removeAll deletes a clipping path when visible text still clips
A group that clips by a mask holding a path and a text object keeps
clipping by the text's outlines after the path is deleted, so
Document.pathItems.removeAll() no longer refuses that case. Hidden
text and hidden subgroups do not clip, so a mask left with only those
still refuses. docs/mcp.md describes the rule.
2026-12-03 00:34:07 -08:00
dotCooCoo 4e90d6c211 Scripts: same_folder builds without a needless bool on Windows
On Windows the Unix block in same_folder is compiled out, which left
`if a == b { return true; } false` and failed clippy's needless_bool
lint with -D warnings in the Windows CI run. The early return now sits
inside the Unix block and the other platforms compare the paths.
Behavior is unchanged on every platform.
2026-12-03 00:09:32 -08:00
dotCooCoo 7a480a7524 Scripts: new paths skip a locked or hidden active layer
Document.pathItems.add() and the shape creators passed the active layer
as onLayer even when it was locked or hidden, so path.create refused it
and the script threw, while textFrames.add() and the app's own creation
commands put the new art on the topmost shown, unlocked layer. The path
creators now choose that layer the same way. While an opacity mask,
pattern or symbol is being edited, they use that edit's layer, and a
locked or hidden editing layer still throws. When every layer is locked
or hidden, the call throws and makes no path.

The creators came in with #9304.
2026-12-02 23:31:52 -08:00
dotCooCoo f4ee5e7be3 Scripts: match the point write's undo step after the switch to its document
Making a background document active can measure its type again and replace the document, so the undo step is now found by the document read after the switch. A test covers a background document whose text is measured again.
2026-12-02 23:26:40 -08:00
dotCooCoo 626994effd Scripts: a text color assigned in a CMYK document is compared as the document stores it
Assigning fillColor or strokeColor on a text range compared the color as
given with the paint the characters have. In a CMYK document an RGB color
is stored as CMYK, so assigning the RGB color the text already stores ran
text.setRangeStyle again and recorded an undo step that changed nothing.
The comparison now converts the color through the text's own document
(its color mode and color settings), so the same assignment records no
step, and text in a background RGB document keeps an RGB color assigned
to it.

The text paint setters came with #9304.
2026-12-02 23:25:17 -08:00
dotCooCoo 3d69c8d49a Scripts: removeAll cannot leave an image first in a group named Image Trace
textFrames.removeAll() and the removeAll() of a group's pageItems,
groupItems and compoundPathItems checked only clip groups whose mask
they release. Deleting the type or art below an image in an ordinary
group named Image Trace left the image first, so the group was read as
a tracing and the image dropped out of pageItems. Both now throw
"Only Image Trace can make a tracing" and delete nothing, checking the
whole set being deleted at once.
2026-12-02 22:58:00 -08:00
dotCooCoo 85d9759773 Merge main into fix/doc-pathitems-removeall-clipping 2026-12-02 22:49:14 -08:00
dotCooCoo ced550ebef Scripts: path points of other Global Edit members go stale when Global Edit changes them
While Global Edit is on, an object model edit of one member (or a move
of a group that holds it) is given to the other members, but the check
that marks read PathPoint handles stale only looked at the edited
object's own subtree. A script that read a point of another member kept
a valid handle after the edit, even when an undo then put the member
back. The check now also looks at each Global Edit member, or the
outermost Objects on Path group that holds it, and skips subtrees the
command left as they were. The stale-point check came in with #9288.

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-12-02 22:34:57 -08:00
dotCooCoo 14e8959bc0 Scripts: tighten rasterize clip bounds and imageCapture destination checks
- object.rasterize and Document.rasterize refuse clipBounds that reach
  none of the selected objects' own bounds, including a rectangle in the
  gap between two of them, instead of replacing the art with a
  background-only image.
- imageCapture checks its destination again on every write the export
  makes and as the file is committed, so a destination that becomes a
  link to an open document or a linked file while the art renders is
  refused.
- imageCapture refuses a destination whose real path is not valid UTF-8
  instead of writing under a name with its bytes replaced.
- A missing linked file's name in the other Unicode normalization form
  counts as the linked file in folders that ignore the form (macOS, and
  casefolded folders on Linux).
- The hard-link tests skip on volumes without hard links.
- docs/mcp.md: imageCapture rounds clip dimensions to the nearest pixel;
  rasterize rounds fractional dimensions up.
2026-12-02 22:19:16 -08:00
dotCooCoo 13488c3103 Scripts: document pathItems.removeAll refuses to delete a clipping path
Document.pathItems.removeAll() deleted every path of the document even when
one was the clipping path of a group or layer that keeps other objects, so
the next object became the clipping path. The scoped collections already
refuse this. The document's collection now runs the same check before
anything is deleted, and also refuses when it would empty a compound path or
group that clips other objects. edit.clear removes an emptied compound path
and keeps an emptied group, and the check follows it.

The fault came with #9041, which added Document.pathItems.
2026-12-02 22:10:09 -08:00
dotCooCoo 4bed43a4e8 Scripts: undoing a point write selects the anchors it dropped again
Writing a script's point changes drops the selected anchors and segments
that the new points no longer have before it runs path.setAnchors, so the
undo step of the edit kept the trimmed selection. Undoing the edit, with
app.undo() in the run or Edit > Undo after it, put the points back but
left them unselected. The step now keeps the selection from before the
trim.

The trim was added in #9304.
2026-12-02 21:54:23 -08:00
dotCooCoo 74e7109026 Scripts: the look for changed path points after each command is charged
After a script reads a path's points, each command makes the run look
through the changed layers and groups of the document for those paths.
That look was not counted toward the script's operation budget, so a
loop of commands on a large layer did unbounded work. It now charges the
objects it looks at, as the layer scans in layers.rs do.

- The look pairs each object with the one of the same id under the same
  parent now, and lists the document once for a group that moved, so no
  object is searched for through the whole document.
- A document none of whose read paths remain is no longer looked at.

The look was added in #9288.
2026-12-02 21:28:43 -08:00
dotCooCoo 72e99d1c3b Merge main into feat/scripts-layer-text-frames 2026-12-02 21:17:26 -08:00
dotCooCoo f7d310828a Merge main into fix/script-transform-stroke-limit-empty-path 2026-12-02 20:54:00 -08:00