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.
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.
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.
path.moveHandles with dx and dy of 0 only changes anchors that become
corners (both handles listed, or `independent`). It still passed every
listed handle on to the edit, so a live shape whose listed anchor needed
no change was expanded to a plain path. The listed anchors that need no
change are now left out, and the command returns without an edit when
none is left.
Follows #9921, which added path.moveHandles.
A click on a path's direction handle picks it, a Shift-click adds it to
the picked handles or takes it away, and Escape lets them go. Picked
handles show ringed. Dragging one of two or more picked handles moves
all of them, on one path or several, by the same offset in one undo
step. A Shift-press on a handle reshapes only once the pointer has moved
3 pixels, so a Shift-click leaves the handle where it is.
The new command path.moveHandles does the move: an anchor with one
handle listed places it as path.setHandle does, an anchor with both
listed moves both and becomes a corner, and independent (Alt during the
drag) makes every listed handle's anchor a corner.
Docs: docs/mcp.md, docs/target-app-parity.md.
expand_to took in the target without checking that it is editable, so a
locked or hidden object inside a selected group replaced the group with
its contents. It now leaves the selection unchanged for such a target.
select.anchors with mode toggle decided whether a path was selected whole
from the rest of the selection, so after a Shift-click had opened a group,
a Shift-click on an anchor of another path in it selected only that
anchor. A toggle on a group member now decides it from the member's own
selection; paths directly on a layer keep the existing rule.