app.getIsFileOpen treated any path with a backslash as a Windows path,
turning each backslash into a folder separator and ignoring letter case.
On macOS and Linux a backslash is a character of a file name, so
getIsFileOpen answered true for the path /work/a\b.ai while /work/a/b.ai
was open.
Paths now get the Windows rules only on Windows or when they start with a
drive letter.
DocumentPreset.typename and toString() answered for a preset kept from
an earlier run with #targetengine, while its settings throw a TypeError.
Both now check the preset the way the settings do.
Documents.addDocumentNoUI(startupPreset) was missing. It now makes the
document addDocument(startupPreset) makes.
The enumerations whose default member an option keeps (OutputFlattening,
CompressionQuality, the PDF color, compression, mark and security enums,
and the SVG encoding, DTD, CSS and font enums) are now defined, so a
script that sets an option to its default no longer throws a
ReferenceError; another member still throws as not available yet.
saveAs, exportFile, app.open and close with SAVECHANGES refuse a path
whose real file name is not valid UTF-8 instead of writing to or opening
a file named with a lossy copy of it.
blend_render_consistency, direct_handle_mirror, ellipse_drag_anchors,
eraser_open_fill, group3_reference, path_fill_hits, pen_space_handle,
preflight and scissors_snap were each a test binary of their own. They
now are modules of crates/engine/tests/it, with their tests unchanged,
so the engine's tests link nine fewer binaries.
The files that stay separate change process-wide state (installed
plug-ins, Safe Mode, the font database, color settings, the working
directory), are run by name from CI or xtask (the Affinity corpus
tests, script_corpus, import_fuzz), or compile for about a minute on
their own (command_sweep), which would make every edit to tests/it
rebuild it.
Docs that named the old paths name the new ones, and the preflight
command in docs/production-preflight.md runs `--test it preflight::`.
Two engine tests ran the same inputs as another test and checked them
again with a tighter bound or a second check.
- commands_that_do_not_wait_for_a_tool_edit_change_no_document ran every
junk case of every non-waiting command on the Single and Multi
fixtures, which every_command_with_junk_params also runs. The junk
sweep now compares tool_edit_state before and after each of those
calls as well as its own panic, interaction and invariant checks. The
tool-edit test keeps only the cases that turn each option on and off
(option_cases), which the junk sweep does not send.
- turned_colored_inflate_facets_and_seams_cover_their_edges_once drew
the same turned Inflate in the same solid fill as one case of
colored_light_surfaces_match_supersampling_at_internal_facet_edges.
That case now carries its bound (at most one RGB channel more than 3
levels off, by no more than 4) and the separate test is removed.
Each merged test fails on a fault that only the removed check caught
before: document.info bumping the revision on a non-object params value
fails every_command_with_junk_params ("document.info "str" [Multi]"),
and solid_surface drawing every facet as a fill and a seam stroke fails
the supersampling test (2 channels off, at most 5).
docs/target-app-parity.md and waits_for_tool_edit's doc comment name
the tests that now hold these checks.
- document.open refuses page, cropTo, pages and crop when a named importer reads the file (linkPages
still uses the built-in reader).
- exportFile with explicit null options throws a TypeError for GIF, PNG8 and TIFF too.
- close(SaveOptions.SAVECHANGES) saves a modern .ai or .ait file and an SVG file with Preserve
Editing whatever range was remembered; a range the save refuses still refuses.
- The script checker keeps a try statement's catch and finally, and an else after a nested
do-while, inside the loop body; a line break after a label does not start a new statement; a
this assignment in a function that hides a global clears the global's saved methods; and
holder.d['saveAs'] = ... no longer counts as a write to d.
- docs/mcp.md describes which files keep every artboard on close.
main's Document member list held saveAs and close as members that are not
available yet; this branch's save_open members implement them, so the
merge drops them from that list and keeps main's other entries. The
script host test lists take main's members together with this branch's
open, userInteractionLevel, fullName, path, saved and option classes,
and the heap accounting keeps main's ModuleNamespace arm beside the
FsEntry string arm.
addon.select.editPointsOnly {segmentEnds?} turns the current selection into
one that holds only anchor points, so a move or transform that follows acts
on the points alone. Selected segments leave the selection, and the points
at their ends leave it too unless segmentEnds is true. Paths selected whole
keep every point. A group or compound path selected whole gives way to the
visible, unlocked paths inside it (no Shaper Group originals, and no guide
paths while guides are locked). Type, images, symbols and other objects
without anchor points leave the selection.
Only the selection changes, so there is no undo step. With nothing selected
or nothing left to keep it is an error and the selection stays as it was.
The command is on the plug-in allowed list.
Object > Plug-ins > Selection Tools > Edit Points Only... opens a dialog
with Keep Ends of Selected Segments; it previews the narrowed selection on
the canvas, OK keeps it and Cancel puts the selection back.
Docs: docs/mcp.md, docs/target-app-parity.md.
A color given as {"c": 1e300, ...}, [1e300, 0, 0], {"gray": 1e300}, a Lab
color or a color object with a number past f32::MAX was stored with an
infinite component. paint.setFill, artboard.setProps, swatch.new,
text.create and the other commands that read colors through
cmd::color_value took it.
- color_value refuses a color whose components are not finite, so the
commands that read a color through it answer an error and change
nothing.
- An effect's color (Drop Shadow, Inner Glow, Outer Glow, Shift to Color)
with such a number is refused with "`color` must be a #rrggbb color".
- ui.colorWheel's contrastBackground refuses it as well.
Docs: docs/mcp.md.
Cause of the CI failures on 212090fd7a:
- main's dialogs::new_document test a_presets_rows_reach_the_document_create_makes
sets artboardLayout.rows to 3.6 and expects 4, but this branch refused a
rows value that was not a whole number. rows now rounds like columns and is
still refused outside 1 to 1000.
- script_host_vs_scriptcheck listed Document.prototype.pathItems=, the
setter of main's placeholder. This branch makes pathItems a read-only
collection, like pageItems, so the row goes.
Object › Plug-ins › Arrange Tools › Offset Objects… (addon.arrange.offset)
puts the selected objects one after another in a row (left to right) or
a column (top to bottom), each a gap past the one before it; a negative
gap overlaps them. The order is the stacking order from the back or the
position (left or top edges), and Reverse Order runs it the other way.
The first object stays where it is, and the others move only along the
row or column, keeping their place across it. Objects are measured by
their visual bounds, a clipping group by its mask. One undo step, none
when nothing moves; bad params are refused.
The dialog has Direction, Gap, Order and Reverse Order with Preview.
Docs: docs/mcp.md, docs/ui-parity.md, docs/target-app-parity.md, ROADMAP.
Object › Plug-ins › Arrange Tools › Match Objects… (addon.arrange.match)
makes the other selected objects match one source object: the key
object, or the top or the bottom selected object. Each can take the
source's width (height in proportion), height (width in proportion) or
both, its bounding-box angle, and its stacking place directly above it
in its layer or group, about a reference point, as one undo step. No
step is recorded when nothing changes, and invalid params are refused.
The dialog previews on the canvas; OK stays off while nothing is chosen
or the source is a missing key object.
Docs: docs/mcp.md, docs/target-app-parity.md, docs/ui-parity.md, ROADMAP.
- saveAs picks the encoder from the requested name, so a link to a file of
another format writes the format the name asks for.
- fullName, path and close(SaveOptions.SAVECHANGES) resolve a relative saved
path against the working directory.
- close(SAVECHANGES) accepts an artboard range that covers every artboard and
keeps the document open when the save would drop artboards.
- app.open keeps the requested file name, rejects a file over 128 MiB before
reading it, applies the requested color space to plug-in imports, and
rejects PDF options for files that are not PDF content; null PDF options
keep their defaults.
- Explicit null options throw; assigning the current Document.saved value
runs no command; Document.path reflects as Folder or string.
- An implicit multi-file save names no refused path in its error.
- The script checker counts SAVECHANGES only on SaveOptions and keeps write
warnings for receivers that evaluated code can rebind.