Commit Graph
12649 Commits
Author SHA1 Message Date
dotCooCoo 89509c31e4 CLI: convert and run --export take --width, --height and --background
The raster export already reads width, height and background, but the
CLI only passed scale and ppi, so those options were reachable through
the MCP export tool alone. convert and run now take --width N,
--height N and --background V and send them for raster outputs only.
A width or height that is not a positive finite number, and a missing
or unreadable background, are refused when the flags are read, for
every output format.

Fixes #10577
2026-12-03 05:58:08 -08:00
dotCooCoo 06fc659299 Scripts: empty paths scale their strokes and refuse a compound's pattern
resize and transform with changeLineWidths equal to the scale now scale the
strokes, dashes and effects of a path with no anchors, as they do for a path
with anchors. A member with no anchors of a compound path or compound shape
that shows a pattern is refused when the call transforms patterns, as a path
with a pattern of its own is.

node.move's description and docs/mcp.md now say that a compound path on a
locked artboard takes a path while it is new art there and still selected.
2026-12-03 04:19:34 -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 fe06a16261 Docs: a Global Adjust stops the pick from linking, not existing links
The Recolor Artwork entry now says that with a Global Adjust other than
0%, the row's swatch pick does not create a link, and art already linked
to that swatch stays linked.
2026-12-03 02:40:06 -08:00
dotCooCoo 7e8c6bae5c Merge main into feat/scripts-api-layer-path-items 2026-12-03 02:24:07 -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 fe3305b9dc Dialogs: a control confirm of a held OK replies with the app's answer
A dialog that holds its OK files the answer for the app, which accepts or
refuses it in the next dialog pump. `ui.dialog.confirm` and `ui.dialog.set`
with `action: "confirm"` replied `{"ok": true}` as soon as the answer was
filed, so a client could not tell that the app refused it (a color
adjustment confirmed while another document is active) and the dialog
stayed open.

`ui.dialog.set` with an `action` also replied with the reply to the
confirm or cancel alone. The MCP `answer_dialog` tool reads a reply
without a `dialog` key as an app that did not answer the dialog, and
sends another `ui.dialog.confirm` or `ui.dialog.cancel`: after an
accepted OK that call failed with "no hosted dialog is open" or answered
the dialog under it.

- Both confirm paths answer with `dialog_reply`, and the app holds the
  reply of a confirm that waits on the dialog's held OK until the app
  answers that opening of the dialog.
- A set with an `action` replies `{dialog, result}`: the dialog as the
  set left it, and the reply to its confirm or cancel, also once a held
  OK is answered. This covers the hosted dialogs, Preferences and
  ScriptUI dialogs; the Simplify and Smooth sliders already replied this
  way.
- A held reply shows the paths outside the read root that the request
  sent by their file names, as a reply sent at once shows them.
- The app polls the held replies right after the dialog pump, before the
  next pass closes an accepted dialog, and after the control requests.
- While a confirm waits on a held OK, the control logic asks for a pass
  (a paint while the window is hidden), so a minimized window answers
  too. A dialog whose OK waits with no confirm on it, such as Print
  during its printer lookup, does not keep the window drawing.
- docs/control-protocol.md describes the held reply and its errors.
2026-12-03 02:05:33 -08:00
dotCooCoo d420a37ba0 Merge main into fix/remove-all-trace-group 2026-12-03 01:55:47 -08:00
dotCooCoo f5f984d7a9 Merge main into feat/scripts-api-d5-swatches-symbols 2026-12-03 01:55:44 -08:00
dotCooCoo 895b542409 Merge main into fix/remove-all-empty-compound-mask 2026-12-03 01:54:59 -08:00
dotCooCoo 76fe270c8a Merge main into fix/script-remove-trace-source 2026-12-03 01:54:08 -08:00
dotCooCoo 0d9dfe6bb8 Merge main into fix/script-clipped-hidden-top 2026-12-03 01:54:05 -08:00
dotCooCoo b18d3c163e Docs: a Global Adjust keeps a row's art off its picked swatch
The Recolor Artwork entry now says that without Limit to Library, a
Global Adjust other than 0% gives the row's art the adjusted color and
does not link it to the swatch picked for the row.
2026-12-03 01:34:55 -08:00
dotCooCoo 6318369391 Scripts: a pattern on a path with no points is not left untransformed
rotate, resize and transform on a path with no points returned success
after setting only the stroke weight, even when the call asked to
transform a fill or stroke pattern the path uses. The pattern stayed as
it was. Such a call now throws "the object has no bounds", as it did
before empty paths were accepted, and leaves the document unchanged.
docs/mcp.md states the exception.
2026-12-03 01:34:27 -08:00
.CooCoo 3dd898fba6 Merge pull request #9260 from dotCooCoo/feat/scripts-layer-text-frames
Scripts: layers and groups give their own text frames
2026-12-03 01:02:35 -08:00
ruchirguitar 164a9ec05f Artboards: avoid duplicate lock submenu rows 2026-12-03 14:22:02 +05:30
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 c738e2e6aa Recolor: Save Changes leaves excluded rows' color, swatch and tint as they are
bake_adjust gave every row the Global Adjust and, with no library
limit, removed every row's picked swatch and tint, excluded rows
included. An excluded row recolors no art, so it now keeps its new
color, swatch and tint, and the other rows still take the adjustment.
2026-12-03 00:10:08 -08:00
dotCooCoo a9d9f524a9 Docs: path creators throw when every layer is locked or hidden
The progress line for Document.pathItems now states, as docs/mcp.md
does, that the call throws and makes no path when the document has
layers and every one is locked or hidden.
2026-12-02 23:58:49 -08:00
dotCooCoo 0313f86491 Docs: name layer and group pathItems in the roadmap 2026-12-02 23:53:38 -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 aeb11d6809 Merge main into feat/scripts-api-layer-path-items 2026-12-02 23:30:42 -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 ad7aebf303 Hyphenation: the focused-edit test clicks another option after typing
The focused-edit test now clicks Hyphenate Capitalized Words after typing a
Words Longer Than count and pressing Tab, and checks that the draft keeps the
typed count while the checkbox changes, in every language and every answer
it runs. OK and the confirmation commit both edits. The docs/mcp.md sentence
on the disabled options is wrapped to the paragraph's width.
2026-12-02 22:16:30 -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 e62b425aa9 Merge main into feat/scripts-api-d5-swatches-symbols 2026-12-02 21:51:58 -08:00
.CooCoo 5470879a85 Merge pull request #9386 from Taha-Mahmoodi/integration/9286-canonical-084
Fix #9286: apply the PDF font preference to synchronous opens
2026-12-02 21:41:31 -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 0ff5dc45d8 Hyphenation: the dialog disables the options that do not apply to the paragraphs
The Paragraph panel menu's Hyphenation dialog left every row editable. Words
Longer Than, After First, Before Last, Hyphen Limit, Hyphenation Zone and
Hyphenate Capitalized Words now take input only while the Hyphenation
checkbox is checked, as the Hyphenation tab of Paragraph Style Options
already does. Hyphenation Zone applies only to a single-line composer, so it
is disabled when every paragraph in scope uses another composer; when the
paragraphs disagree it stays available. Automation is refused on a disabled
row as it is on screen.
2026-12-02 21:21:35 -08:00
dotCooCoo 72e99d1c3b Merge main into feat/scripts-layer-text-frames 2026-12-02 21:17:26 -08:00
dotCooCoo 8696df27f6 Merge main into feat/scripts-show-color-picker 2026-12-02 21:09:03 -08:00
dotCooCoo f7ed9b5b3c Merge main into feat/print-per-job-settings 2026-12-02 20:55:56 -08:00
dotCooCoo b81ede3532 Scripts: pathItems.removeAll keeps clipping paths; empty paths refuse stroke-only scaling
- pathItems.removeAll() now throws and deletes nothing when it would delete
  the clipping path of a group or layer that keeps other objects, as
  pageItems.removeAll() does. The check is shared with the art collections,
  and the document's collection counts compound paths that edit.clear
  empties and deletes.
- rotate, resize and transform check changeLineWidths at the
  transformation's own scale with changePositions false before the early
  return for a path with no points, so an empty path is refused as one with
  bounds is instead of having its stroke weight set.
- docs/mcp.md describes both.
2026-12-02 20:54:39 -08:00
dotCooCoo f7d310828a Merge main into fix/script-transform-stroke-limit-empty-path 2026-12-02 20:54:00 -08:00
dotCooCoo 252e2ef3d4 Recolor Artwork: a waiting picker answer, excluded rows and removed group swatches
- The pump applies a Color Picker answer only while the row is the one the
  picker answered; a row that ui.dialog.set changed in between takes neither
  the color nor the swatch, and the status line says the rows changed.
- An excluded row offers no Tint slider, since recolor.apply skips its art;
  the row keeps its tint.
- A row picked from a group swatch that groupColors removes (null) offers no
  Tint slider; its chip keeps the tinted color, which the art takes unlinked.
- docs/mcp.md and the recolor.apply params say a null swatch is no swatch.
2026-12-02 20:44:04 -08:00
dotCooCoo f46d591204 Merge main into feat/scripts-api-d8c-rasterize-capture 2026-12-02 20:30:16 -08:00
dotCooCoo 80569dc577 Scripts: deleting a clipping path cannot make a tracing
remove(), the document's pageItems.removeAll() and textFrames.removeAll()
release the mask of a clip group whose clipping path they delete. A clip
group named Image Trace with an image next above its clipping path then
became an ordinary group named as a tracing with an image first, which
reads as a tracing. They now throw "Only Image Trace can make a tracing"
and delete nothing in that case.

docs/mcp.md names the removeAll() collections that release a mask and
the ones that refuse to delete a clipping path instead.
2026-12-02 20:24:21 -08:00
dotCooCoo 8714ec7731 Scripts: rasterize refuses sources clipped differently, capture checks file identity
- object.rasterize with ids refuses objects whose nearest clip group or
  clipped layer differs, before rendering: the image goes where the last
  object is, so mixed sources would be clipped by another object's path.
- Document.rasterize reads the image id from the command's result inside
  the run's savepoint, so an id above 2^53 binds the new RasterItem and a
  missing id undoes the edit.
- Document.imageCapture refuses a destination that is another name of an
  open document's file or a linked file (same device and inode, or same
  volume and file index), and on Unix any file with other hard links,
  which an in-place write would change under every name.
- Docs: gaps.md and target-app-parity.md list what rasterizing and
  capturing still lack; mcp.md states the clipping rule, the hard-link
  rule and that a later OS write failure can leave some files written.
2026-12-02 20:10:56 -08:00
dotCooCoo fecec6974c Docs: ruler guides do not keep a clipping path from removeAll()
docs/mcp.md and docs/target-app-parity.md now say that the objects that
make removeAll() refuse to delete a clipping path exclude ruler guides,
as the check in crates/engine/src/script/dom/layers.rs does.
2026-12-02 19:58:03 -08:00
dotCooCoo 0998156ce0 Print: with no scheduler named, IPP_PORT decides whether local PPDs apply
With no CUPS_SERVER or ServerName and no CUPS domain socket, CUPS uses
localhost on the IPP_PORT port. The local PPD check treated that case as
local on any port, so with IPP_PORT=8631 the Print dialog listed the local
PPD's sizes instead of those of the scheduler on 8631. The check now
resolves the implicit scheduler the way the IPP lookup does: a CUPS socket
is local, and otherwise localhost on IPP_PORT is local only on port 631.
2026-12-02 19:36:41 -08:00
dotCooCoo 6aa10bfbf9 Docs: name the compound path's pathItems for the clipping path removeAll rule 2026-12-02 19:33:30 -08:00
dotCooCoo fabc6c45ad Scripts: pathItems.removeAll cannot empty a compound path that clips other art
`removeAll()` on the `pathItems` of a compound path deleted every path even
when the compound path was the clipping path of a group or layer that keeps
other objects, which left an empty clipping path. It now throws the same
"cannot delete a clipping path" error that deleting the clipping path itself
gives, and deletes nothing. The collection `removeAll()` came in with #9048.
2026-12-02 19:30:12 -08:00
dotCooCoo e0632d6f79 Docs: scope where unknown halftone styles are rejected
object.vectorHalftone, effect.apply and effect.setParams reject an
unknown style. A stored effect with an unknown style draws as Custom.
2026-12-02 19:27:08 -08:00
ruchirguitar 6bfe0016ba Merge upstream main into Script Console row menu 2026-12-03 08:46:18 +05:30
dotCooCoo e10dc47ae8 Scripts: doScript steps act on the artboard the script made active
After a script called setActiveArtboardIndex, a paste or Fit to Artwork
Bounds step that doScript played still went to the Artboard tool's
selection from the start of the run, so it pasted on or fitted those
artboards instead of the one the script chose. The script's choice now
also replaces that selection, until a revert discards it.

The choice was added in #9048 and the kept selection in #9055.
2026-12-02 19:08:51 -08:00
dotCooCoo d3eb174b6d Image Trace: object.newGroup at index 0 no longer ends a tracing
An Image Trace object keeps its source image as its first child. object.newGroup
with index 0 put the new group below that image, so the group stopped being a
tracing. Index 0 in an Image Trace object is now refused before anything
changes; index 1 puts the group directly above the source image.

The index parameter came with #9048.
2026-12-02 19:07:05 -08:00
dotCooCoo 7803df68bc Print: CUPS_SERVER IPv6 addresses and IPP_PORT reach the right scheduler
An IPv6 address named as the CUPS server without brackets (`fd00::cafe`,
or `fd00::cafe:8631` with a port) produced an IPP queue URI with the
address unbracketed, which ipptool rejects, so a queue with no PPD and
no lpoptions sizes listed no paper sizes. ipp_queue_uri now splits the
host and port as cupsSetServer does, brackets an IPv6 host and encodes
a zone separator as %25.

The local PPD check ignored IPP_PORT, so `CUPS_SERVER=localhost` with
`IPP_PORT=8631` read this machine's PPDs for another scheduler's
queues. A server named without a port now takes the IPP_PORT port
before the check.

The IPP fallback and the local PPD check came in #10581.
2026-12-02 19:06:57 -08:00