- Each ScriptUI element gets an id that the dialog's description carries. The
app keeps a queued click or change, and each typed text, with its control's
id instead of the control's position in its container, so a handler that
removes a control no longer sends a later click or typed text to the control
that moved into its place. An event whose control was removed is dropped,
and so is a queued list change when a handler changed the list's items.
- A container that no longer holds the control when its turn comes does not
get the event, and a listener that an earlier one removed in the same event
does not run. The containers above the target stay kept from collection
while the listeners run.
- A removed control and the controls it holds have no `window`; `removeAll`
throws on them like `add` and `remove`.
- Every element starts with its listener list, which a script cannot replace,
and `remove` and `removeAll` refuse an object made to look like an element
of a real dialog.
- docs/mcp.md says a group takes its properties fourth when the third argument
is not an object, as the code does.
- A control with alignment fill stays within its maximumSize when its
container's room is larger.
- A window or control takes at most 256 event listeners (VectorCraft's
own limit); one more throws a RangeError. A show listener can be
added only to the dialog, and on a control it throws an Error.
- A capturing listener on a container that stops a click keeps the
default or cancel button from closing the dialog. Listeners on the
containers that do not capture still leave the button to close it.
- stopPropagation() acts only on an event whose listeners are running,
and preventDefault() does nothing, since the events are not
cancelable.
- A control removed from its container has no parent, its events no
longer reach the containers it was in, and add and remove on it, or
on a control it holds, throw an Error. Its controls are no longer
counted toward the dialog's limits.
- remove(text) throws an Error, and removes nothing, when a text getter
changes the list or container while it looks for a match.
- A group takes its creation properties fourth again when the third
argument is not an object, as in add("group", undefined, undefined,
{name: "g"}).
- A click on a radio button now turns off only the radio buttons of its
set, the ones added next to it with no other kind of control between
them. It used to turn off every radio button in its container.
Docs: docs/mcp.md now says that notify runs the handlers without closing
the dialog.
- Every element starts with preferredSize, size, minimumSize and
maximumSize objects whose width and height are -1, so a script can
set one side, as in preferredSize.width = 100. A positive side of
size takes the place of preferredSize's, and the layout keeps a
control within its minimum and maximum.
- Controls and the dialog take addEventListener and
removeEventListener for click, change, changing and show. Handlers
run in the capture phase on the containers, on the control after its
onClick, onChange or onChanging, then on the containers again until
one calls stopPropagation(). A button with a click listener no longer
closes the dialog by itself.
- Window.alert, Window.confirm and Window.prompt open the same dialogs
as alert, confirm and prompt.
- A list has find(text) and remove(what), and takes its items in
properties.items; a container has remove(what).
- A group takes its creation properties as the third argument of add(),
and orientation, alignChildren, spacing, margins and alignment given
there are its first values.
- Setting a radio button's value to true turns off the radio buttons
added next to it in its container, and notify("onClick") turns a
radio button on and a check box over before onClick runs.
Docs: docs/mcp.md, docs/target-app-parity.md.
When a handler takes the run past its growth limit, the question to
continue now opens over the ScriptUI dialog, and Continue shows the
dialog again with the events the script has not had yet and the text
typed in its fields.
A queued click or change keeps where its control sits in the dialog,
and a typed text keeps where its field sits, so both reach the same
control after a handler adds controls before it.
A text longer than 16 KiB that an edit field gives as it loses the
focus now goes back in the field, with the error in the status bar,
instead of being dropped when the next frame draws the script's old
text. The field keeps it until the person changes it.
ui.dialog.cancel, and ui.dialog.set with action cancel, now return the
error when a ScriptUI dialog holds a typed text longer than 16 KiB, as
ui.dialog.confirm does. The dialog stays open with every field as it
was. Escape still shows the error in the status bar.
- OK, Cancel, Escape, ui.dialog.confirm and ui.dialog.cancel now check every
text still typed in the dialog's edit fields before giving the script
any event. When one is longer than 16 KiB, every field keeps its text,
nothing is queued, and the click or cancel returns an error (Escape and
the dialog's own buttons show it in the status bar). A disabled or
hidden field keeps its typed text and is not sent.
- The quit question forgets the ScriptUI dialog it was asked over once
the run has gone on to a different show(), so Cancel does not show the
old dialog again.
- A show() that a handler's error ended with steps left in `answers` now
ends the run and rolls it back, even when the script catches the error.
- A list step's value written as a whole float (1.0) is an item index,
in `answers` and in ui.dialog.confirm; a fraction is still refused.
- A progress bar's fraction stays finite across the widest range.
- add() checks the control and item counts again after the getters and
conversions it runs, refuses an initial item array longer than the
items left before reading it, and counts a new list's items only once
the list is added.
- show() keeps the values a getter gives while their properties are
read, and reads the dialog again when a getter changes a list after
it was read; a list that changes again throws an Error.
- A click or close from ui.dialog.confirm gives the text still typed in
the dialog's fields first.
- Quitting while a handler runs keeps the dialog and its queued events,
so Cancel shows it again with them.
- Screen readers call an edit field without a name by the visible static
text just before it in its container.
- The dialog's heading follows a title a handler changed while the
dialog is open.
- A list box gives screen readers a list box node named by its name or
the static text before it, with the selected item as its value, and a
drop-down list is named the same way.
- The dialog closes when show() returns, also when the script goes on
running.
- Enter clicks the default button while the keyboard focus is on a
control other than an edit field, such as a slider.
A script can now build a modal dialog with new Window("dialog", title)
and add() groups, panels, static text, edit fields, buttons, check
boxes, radio buttons, drop-down lists, list boxes, sliders and progress
bars. The engine checks the description and lays it out without
recursion, within VectorCraft's own limits (512 controls 16 deep, 1024
list items, 16 KiB a text, sizes clamped to 8192 px). Other control
types, palettes and resource strings throw that they are not available
yet.
- show() waits like alert, runs onClick, onChanging, onChange, onShow
and onClose in the run's fuel, and returns close(result)'s result, 1
for the default button or 2 for the cancel button, or 0 for the close
box. A show() inside a handler throws.
- In the app the dialog draws the controls where the engine placed
them, gives text still typed in a field before a click or a close,
and keeps its state while a handler runs. Enter clicks the default
button, Escape the cancel button, and Stop ends the run and puts the
documents back.
- A run over MCP or the command line takes a window answer: the steps
of one show(), each a click, a change or a close.
- The report lists each dialog with its controls, events and result;
vc.api.has("scriptui") is true.
Docs: docs/mcp.md (script.run), docs/target-app-parity.md.
A global or spot color that a library pattern's art brings under a
numbered name no longer takes a name the library gives another swatch.
Before, adding a pattern whose art uses "Ink" to a document with another
"Ink" brought the color as "Ink 2" even when the library has its own
"Ink 2"; adding that library swatch next then came in as "Ink 2 2". The
brought color now takes the next free name the library does not use
("Ink 3"), and every paint linked to it follows the new name, so adding
the library's "Ink 2" next adds it under its own name and adding both
again adds nothing.
A color the pattern's art brings or takes is the color a library tint
or gradient links to only when it has the library color's paint and its
process, global or spot kind, as for the other lookups in the same add.
The test a_numbered_copy_named_like_another_library_color_is_found now
makes the blue "Ink 2" itself, as an earlier version's pattern add left
it, since a pattern add no longer gives that name.
A press keeps the pointer and the snapped point for the end of the piece it adds. When Alt
changes the action during the press, the end goes through the protractor's tick again for the
new action, so a continuous arc that snapped to a tick and becomes a sharp-corner arc ends at the
pointer, and a piece that becomes a continuous arc goes onto the tick, without waiting for the
next drag. This also covers a press that has not dragged.
A continuous arc that starts a path has no direction to follow and
sweeps the arc size, as a sharp-corner arc does. Moving its end onto a
protractor tick put the end on a circle the drawn arc does not follow,
so `tick_end` now gives no tick for it.
The hover keeps the snap settings it was made with (`SnapSettings` in
guides/snap.rs: the window, zoom, snapping options, tolerances,
Alignment Guides and construction angles). After one of them changes
under a still pointer, the hover's rubber band, protractor, distance
label and Smart Guides are hidden until the pointer moves, also through
a press, so the preview shows no point that a click would not place.
A press also drops the hover, so after a click puts an arc's end on a
tick no preview runs from that end back to the pointer. While the
pointer hovers, the tool asks the canvas to hover it again when the
view, the document or the selection changes (`wants_rehover`).
While an arc is drawn, by a drag or as the piece the next click adds, the
Quick Pen tool shows a protractor around the arc's center: a tick every 15°
from where the arc starts, a longer one every 90°, and one where it ends. The
piece the next click adds shows its protractor only while Enable Rubber Band
for the Pen tool shows that piece.
With Smart Guides on, the end of a continuous arc snaps onto the nearest tick
of its protractor, on the same circle, when the tick lies within the snapping
tolerance of the pointer, no other Smart Guide snaps the point, and neither
Snap to Grid nor Snap to Pixel snaps drawn points. A sharp-corner arc sweeps
its arc size, so its end does not snap. Shift does not constrain Quick Pen
points, so it does not change the snapping. The protractor, its 15° step and
the snapping are VectorCraft's own behavior.
The Smart Guides targets now also report whether a point landed on one of
them (`Targets::snap_hit`), so a target whose label or line is hidden still
takes precedence over a tick.
Adds tests for the arc's circle, the tick snapping by drag and by click and
its precedence, and the protractor during a drag and while hovering. Also adds
tests of existing Quick Pen behavior: a point snapping to a Smart Guide, and
the distance label shown while hovering.
A pass-through group's adjustment layers count as kept to change what is
below the outer pass-through group only when nothing below that group in
the outer one draws, as for adjustment layers directly in the outer group.
Before, a layer merged above them for its blend mode merged them applied
but the import counted them as not applied.
docs/mcp.md now says when a layer's mask hides all of it.
A library tint or gradient counts as already in the document only when
each color it links to is there. When the document's tint of that name
links to a color the document no longer has (deleted without unlinking),
the color comes back under its own name and is listed in `added`.
A picked pattern the document already holds keeps the copy of a color
its art takes (a numbered copy the library also names), and the picked
tints and gradients of that color link to it, so adding the pattern and
the tint again adds nothing. Without such a pattern, a numbered copy the
library also names stands for that library swatch alone.
docs/mcp.md also states that a pattern pasted with Merge for some colors
and Add for others is added again as a copy.
A layer or group whose layer mask, switched on, hides all of it now counts
as drawing nothing when the import decides what an adjustment layer
changes. A layer with stored pixels is hidden when its mask is 0 over all
of them. A group, an adjustment layer and a layer that stores no pixels
are hidden only when the mask is 0 everywhere, the value outside it
included.
- An adjustment layer above such a layer or group in a pass-through group
is kept to change what is below the group, instead of merging with
pixels that never show.
- A shallow knockout hidden by its mask merges nothing, so the adjustment
layers kept below it in a pass-through group stay in the group's kept
set: an adjustment layer above that group in an outer pass-through group
is kept after them, and both change what is below.
- A clipping base hidden by its mask draws nothing, its clipped layers
included.
Each mask is read once for this, only when it can hide all of the layer,
and the read is not counted against the import's memory allowance, since
the mask is read and counted again where it is drawn.
Docs: docs/mcp.md, docs/target-app-parity.md.
swatch.library.add linked a library tint to the wrong color in two cases.
When the document had a process color with the same name and paint as the
tint's global color, the global color counted as already present and the
tint linked to the process color. When a tint was added without its global
color and the document had another swatch of that color's name, the tint
linked to that swatch.
- A library color counts as already in the document only when the
document's color of that name is the same kind: process, global or spot.
A global color whose name the document gives a process color now comes
in under a numbered name, and its tints link to that copy.
- A global or spot color that an added tint or gradient links to, and that
the document does not have, now comes in with the tint or gradient. It
keeps its own name when that name is free and gets a number otherwise.
added lists it after the picked swatches.
- A library tint is not the document's tint of the same name and paint
when the document's swatch of the base's name is another color or kind.
- A tint that a pattern brought is used for a picked library tint only
when the color it links to is the library color's kind.
- An adjustment layer's mask is checked against the memory allowed beside
the canvases held while it is read (the merged canvas, the base's shape
and the copies kept for pass-through groups).
- A clipped adjustment layer whose mask is too large to read is left out
without unclipping the layers clipped above it to the same base.
- An adjustment layer in a pass-through group whose mask is too large to
read is left out without stopping the merge of the layer above the
group; its own merge with the layers below it still isn't made.
- A layer whose stored pixels are all transparent draws nothing, so an
adjustment layer above it in a pass-through group stays kept to change
what is below the group.
- A layer merged in a pass-through group for its blend mode or its
knockout takes the adjustment layers kept below it with it, so an
adjustment layer above that group in an outer pass-through group merges
with it instead of being dropped.
When a library tint waits for a color that a pattern's art brings,
swatch.library.add learns the color's name by importing the pattern into
a copy of the document. The import into the document now confirms those
names: when it gives a color another name, or none, the tints linked
from the copy are linked again.
- library.use and Add to Swatches report an error from the import that
merges a pattern's colors instead of falling back to adding them.
- The params text, docs/mcp.md and docs/target-app-parity.md say that a
tint or gradient links to the numbered copy its global or spot color
comes in under or already has, and name a gradient test.
- The new code uses the HashMap import, and one helper relinks the
added tints and gradients at both places that did it.
- A hidden pass-through group, kept with the hidden layers, and an
adjustment layer at 0 opacity or 0 fill no longer hold back the
adjustment layers above them in a pass-through group.
- Layers that draw nothing (no pixels stored, 0 opacity, or 0 fill with
nothing clipped to them) and groups of only such layers don't count as
content below an adjustment layer, so in a pass-through group it still
changes what is below the group. Layers clipped to a layer at 0 fill
or to an adjustment layer count as content.
- An adjustment layer whose layer mask is too large for the memory
allowed is counted as not applied, merged or clipped, instead of
stopping the layered import.
The Annex B runners checked their folders with Path::exists, which returns
false when the metadata cannot be read, so a folder that could not be
searched skipped the tests as if it were absent. They now use try_exists:
only an absent folder skips, and a metadata error fails the test.
The parity doc now says that an interpreter panic fails annex_b_runs and
makes cargo xtask test262 exit non-zero, while conformance failures do not.
A library tint or gradient whose global or spot color comes in under a
numbered name now links to that copy whichever order the swatches are
picked in, when the color was added by an earlier call, and when a
pattern's art brought the color or took the document's copy of it.
Adding the same tints again finds the ones added before.
- Each tint's or gradient's color is looked up for itself before
anything is added, past a process swatch of the same paint and past a
color group of that name. A numbered copy that the library's own
swatch of that name is stays that swatch's, and a new copy skips the
library's other names.
- A tint links to a global or spot color of the same kind only, and to
a color this call picks rather than to a copy a pattern took.
- Links are set as soon as the color's name is known. A tint waiting
for a color that a pattern's art brings learns its name from an
import into a copy, so the pattern does not add a second tint.
- A swatch a pattern brought takes a picked swatch's place only when
its colors link where the picked one's do.
- A stop linked to the Registration swatch counts as linked.
- library.use, Add to Swatches and the reuse check share one import
probe (patternlib::probe_import), and the probed copy is kept instead
of importing a second time.
Docs: docs/mcp.md, docs/target-app-parity.md.