- A saveAs or exportFile in an object literal whose body uses `this` or
the variable's own name may replace the object's methods when it runs,
so the script check no longer counts it as the script's own method and
reports its calls as file writes.
- An assignment to a property of the global object under a key that is
not one string literal (`$.global[key] = d`, `this['lo' + 'cal'] = d`)
may rebind any variable, so the check forgets every own saveAs after it.
- A save without a path that writes several files and is refused by the
file access names the refused file by its file name, as the
single-file save does, instead of its full path.
The contrast row, its menu rows and its tests move to the craft UI framework,
as main's Color Wheel panel now uses it:
- The row is a Row with a Swatch named Background (a color well whose value is
the background's hex value) and Text for the ratio and the AA and AAA
results, each with the WCAG minimums as its tooltip.
- Show Contrast, Contrast For and Contrast Background are rows of the panel
menu's items (ui.colorWheel.contrast, contrastFor.<id>,
contrastBackground.below and contrastBackground.current), after Show
Opacity. Current Color is gray, and its row answers an error, while the
active proxy has no solid color.
- The kept background and ratio answer are fields of WheelUi instead of panel
state. The answer's key also holds whether the Live Paint Bucket paints,
which changes the proxies' paint without a document revision.
- The row's tests run in the panel's Fixture by accessible name; the drag test
runs an interaction whose previews set the fill, as the Show Document Colors
drag test does.
- The settings lists in the params text, docs/mcp.md and the tests take both
opacity and the contrast keys.
Document.exportForScreens exports the artboards, the assets and the document
that itemToExport names one after another into the folder. A later export now
names its files around the names the earlier ones took, so an asset named as
an artboard writes Logo-2.svg next to Logo.svg instead of writing over it.
When the file access in force refuses one of the files a save writes, the
save returns the access error before calling the writer, so a writer that
does not check the file access itself writes none of the files.
A plug-in folder load checks each file against the automation roots and,
in a command a script runs, the script's read gate. A file whose name
isn't valid text cannot be checked by name, and without automation roots
it loaded unchecked, also in a script's command. A link with such a name,
in a folder the script may read, loaded a module from anywhere.
Such a file is now refused in a script's command, as it already was under
automation roots. Outside both, it still loads.
When the paths together are over the segment limit, the search maps the
paths near the point and leaves out the ones with the most segments. A
path left out made the search give up on an area when it came within the
gap plus 1 pt of the area's outline, so with Gap Detection off a long line
0.75 pt outside a square stopped a click inside the square from filling
it. A gap bridge reaches at most the gap, so the check now uses the gap
plus the map's 0.05 pt contact tolerance. The 1 pt padding still decides
which paths the search picks.
Most of this pull request reached main with #4221 (the smooth join and the
redraw preview). What is left:
- A redraw stroke's end bends onto the path over Edit selected paths' distance.
When the stroke's points are far apart (a fast stroke), the bend used to run
on to the next point; a point is now added where the bend stops, and only one
where both ends' bends stop at the same place.
- The preview of a redraw stroke is drawn on top, as with Draw Normal, in Draw
Behind and Draw Inside too; before, it went behind the path or into its clip
group. path.freehand's `leaveSelection` becomes `preview`, which does both.
Fill Area used the full outline of art inside a clipping group, so a
click in the part a mask hides still found an area, and the new path
above the clipping group showed art the mask hid. Now each clipped
path is cut to every mask around it before it bounds areas, nested
clipping groups and clipped layers included: a filled path keeps its
overlap with the mask, and the outline of an unfilled path and open
paths keep only their pieces inside it. A mask that clips to nothing
hides what it clips. The new path still goes above the clipping group.
Follows #8001.
After a selection square is clicked, Shift-clicking another selects the
art of every row listed from the last square clicked to this one, down or
up and across sublayers and groups. Shift+Ctrl/Cmd-click adds that art to
the selection. Hidden and locked rows and art outside the isolated group
are left out, and a range does not move where the next Shift-click
starts. Before any square is clicked, Shift-click still adds one row's
art or takes it out. Ctrl/Cmd-click on a square now does the same; it
used to select the row's art alone, as a plain click does.
The panel menu's Select Art of Highlighted Rows selects the art of the
highlighted rows by the same rules.
- layer.selectAll takes {range: [id...], add?}, gathered with
Selection::target_range as the target circles' ranges are.
- layer.selectHighlighted {add?} is new. Neither is an undo step, and
the highlighted rows stay.
- Docs: docs/mcp.md, docs/target-app-parity.md.
A selected ruler guide was left out of every transform but a move: the
Rotate tool did nothing with only guides selected, and Object › Transform
› Rotate… refused with "nothing selected".
Each selected ruler guide now transforms as the line Release Guides makes
of it (across its artboard, or across the artboards' bounds for a canvas
guide), about the center of the selected objects' box and those lines
together. A guide that ends up vertical or horizontal stays a ruler guide:
a half turn keeps it and a quarter turn makes a horizontal guide vertical.
At any other angle it becomes a guide path along its line, on the guide's
layer, so it snaps, releases, locks and saves as other guide paths do.
- Object › Transform › Rotate… (Copy included), Transform Again and the
Rotate tool's drag and Alt-click work with only guides selected, in one
undo step. A turn that leaves the guides where they were records none.
- Scale, Reflect, Shear and the bounding box now transform selected guides
along with the selected objects and direct-selected anchors, where
before the guides stayed put.
- Locked and hidden guides, guides with ids given and guides with
Transform Objects off do not transform. `absolute` with only guides
selected is an error.
Part of #2418.
- Document.selection = undefined (an index past the end of pageItems) throws
"this is not a page item" and keeps the selection; null and [] still clear
it. Repeated items are found with a set instead of a scan of the list.
- Assigning a page item the opacity it already has runs no command, unless a
graph keeps another opacity for the item's series or kind.
- PageItems.toString() on a stale collection throws as typename does.
- PageItem.controlBounds throws "not available yet" instead of returning the
visible bounds, which leave out the direction handles.
- A host class member that is not available hides an available member of the
same name in the class it descends from, for hasOwnProperty and
propertyIsEnumerable.
- script.check: a call of another method of an object literal with its own
saveAs or exportFile (local.install()), and a property assignment that names
the variable (this.local = d, $.global['local'] = d), end the exemption, so
a later saveAs counts as a file write.
- docs/mcp.md: SCALEBYFACTOR is a multiplier from 0.01 to 64, and
SCALEBYRESOLUTION takes 0.72 to 4608 ppi. The write_encoded doc comment
limits the all-or-nothing case to paths the access check refuses.
- Tests: the authored error-origin case throws the Window text, the
getIsFileOpen paths are JSON string literals, the folder saveAs case looks
up its grant and expects "Script file is not a regular file", the
selection case catches the error inside the script, and the close case
checks that the file changed.