The Paintbrush with a brush whose Size or Width is on Stylus Wheel with
a range the wheel can change, or the Eraser with a value on Stylus Wheel
and a variation above 0, uses the wheel. The app asks the active tool
(Tool::reads_wheel) once a frame and tells the host when the answer
changes (Services::stylus_wheel). Until a tool uses the wheel, a pen
message loads no Wintab32.dll, installs no hook, subclasses no window
and opens no context; when it stops, the context closes.
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.
A Pressure or Stylus Wheel stroke whose samples all lie at one point
gave path.blob a spine with no length, and the command failed with
"empty brush stroke". It now paints one dab sized from the first
sample's reading, as a single point does.
When Size changes from Fixed to Pressure or Stylus Wheel during a drag,
the release sends no pressure or wheel for the stroke, so it paints at
the Size. The tip outline now reads the pressure and the pen pose only
when the release reads them, for the Blob Brush and the Eraser.
Smooth Tool Options gets a Smoothness setting under Fidelity, from 0% to
100%, where a higher value leaves a smoother path, as the help page
describes the setting:
https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=164
- path.smoothRegion takes an optional `smoothness` (0 to 100, 50 when
left out). It scales the spread of the averaging done before the
refit in proportion: none at 0, today's spread at 50, twice it at
100. A value outside 0 to 100 is an error and changes nothing.
- The Smooth tool keeps the option with its preferences and sends it
with each drag; Alt smoothing with the Pencil, Paintbrush and Blob
Brush uses it, as it already uses the Smooth tool's Fidelity.
tool.setOption refuses a value outside 0 to 100.
- The default and the way the percentage scales the smoothing are
VectorCraft's own; the default keeps today's strength.
Docs: docs/mcp.md, docs/target-app-parity.md.
A saved preferences file is restored onto the drawing tools without the
option check that tool.setOption applies. A Spiral segment count or a
grid divider count that was not a whole number (a string, a fraction, a
negative, null) reset the tool to 10 or 5 instead of keeping its
current count. The Arc tool's base axis took any string other than y as
x. Each now keeps its current value for such a value, and a whole
number keeps its existing range.
While a shape is dragged out, an ignored count or axis no longer
replaces the drag's starting value, so Escape puts back the values the
drag started with.
Blob Brush Tool Options' Size menu offers Stylus Wheel beside Fixed and
Pressure. With it the brush is Size - Variation wide at one end of an
airbrush pen's finger wheel travel and Size + Variation at the other, in
a drag, a click and with a tip that is not round. A point without a wheel
counts as half way, and a mouse stroke keeps the Size.
- path.blob takes sizeMode "stylusWheel" with the wheel seventh in each
point, and its error for an unknown sizeMode lists the three modes.
- The tool keeps the mode, records the wheel, and sends it on release.
While the Blob Brush paints, its tip outline takes the size the pen
gives (on Pressure too), and keeps the set angle and roundness. A wheel
turned with the pen held in place updates the last sample.
- The Eraser's Size already offered Stylus Wheel and is unchanged.
Docs: docs/mcp.md, docs/target-app-parity.md.
The band a smoothing drag shows took the Smooth radius in points without
the 1,000 pt bound the release applies, so below 1.2% zoom it drew wider
than the region path.smoothRegion smooths. It now uses the same bound.
path.smoothRegion read a radius below 0 as 0 and moved a fidelity into its
range, and path.joinScrub read a tolerance below 0 as 0. Each now refuses
a value outside its range with an error naming the key, and the document,
the selection and the undo history do not change: radius and tolerance
0.001 to 1000 pt (the Path Eraser's width range), fidelity 0.000078125 to
about 3195 pt (the Smooth tool's 0.05 to 100 px at the highest and the
lowest zoom). A key left out or null keeps its default.
The Smooth, Join and Path Eraser tools, and an Alt smoothing drag with the
Pencil, Paintbrush or Blob Brush, keep what they send within these ranges
at any zoom, also when the interface zoom puts the tool's zoom past the
view's range.
Docs: params text, docs/mcp.md, docs/target-app-parity.md.
The outline of an Eraser drag takes, at each step, the tip the pen gives
halfway along it, as path.eraseRegion erases. Two cases still used the
tips at the step's ends:
- A round tip whose Size follows the pen drew each step as wide as the
mean of the tips at its ends. Where an end is held at the 0.1 pt least
size, that mean differs from the tip halfway along: with Size 10 pt on
Pressure by 20 pt, a step from no pressure to full pressure showed
15.05 pt wide where the release erases 10 pt.
- A pen turned or tilted in place at the last point updated the last
step only when the tip at that point changed. With Size 10 pt on Tilt
by 20 pt, tilting from 80 to 85 degrees after an upright point keeps
the end tip at 0.1 pt while the tip halfway along goes from 12.22 pt to
11.11 pt, and the outline kept the old one. The area outline now keeps
and compares the tip halfway along the last step.
With Smart Guides on, hovering a shape tool over another object's anchor
or edge shows the "anchor" or "path" label where the new shape would
start. When the pointer then left the canvas, went under a panel or
menu, or a middle-button drag started panning, the label stayed on the
canvas at the last hover point. The Rectangle, Rounded Rectangle,
Ellipse, Polygon, Star and Line Segment tools now drop it when their
hover ends, and so do the Arc, Spiral, Rectangular Grid and Polar Grid
tools, as the Scissors tool already does.
Show the native point marker at the existing cut target, respecting consumer endpoint eligibility/canonicalization and current snapping/selection. Keep cut commands unchanged.
Closes#8655.
The Bristle tip outline reads the five pen controls and leaves the
wheel unused. The bristle tip test's pen pose gives no wheel, and the
eraser test's mode error lists `stylusWheel`.
With the Anchor Point tool chosen, dragging a direction handle with Alt
held now links it with the opposite handle and makes the anchor smooth,
on paths and on a selected blend's spine. A drag without Alt still moves
one handle on its own, an Alt-click still retracts the handle, and the
Pen with Alt keeps moving a handle on its own.
- path.setHandle and object.blend.spine.moveAnchor take link: the other
handle turns in line at its own length; a retracted one is pulled out
to the dragged handle's length where a segment leaves the anchor on
its side, and stays retracted at an open end. A request that changes
nothing records no undo step; link with independent, a non-boolean
link and, for the spine, link without handle are refused.
- Anchor::set_handle measures long handles without overflowing, so
turning a very long handle no longer writes NaN or infinite points.
- The two new error messages have rows in the message catalogs.
Docs: docs/mcp.md, docs/ui-parity.md, docs/target-app-parity.md.
The checks that look only at selected blends' spines (Direct Selection's
hover, press and marquee, the Anchor Point tool's press and handles, and
the Pen's click on a spine) walked the whole document and built every
blend's spine before keeping the selected ones. They now go through
direct::selected_spines, which returns an empty list when no selected
object is a blend and otherwise keeps the same order and filter. The
check that finds a point on any blend's spine is unchanged.
On 20,000 paths and 200 blends, 500 checks with one plain path selected
took 24 us instead of 336 ms; with one blend selected the time is the
same. Results are compared against the old filter in the tests.
The Spiral tool's option check took a decay up to 150 while the tool keeps
at most 99.99, so `tool.setOption` reported success with another value. It
now takes 5 to 99.99. The Arc tool's lengths are checked from 1e-9 to 1e6,
the lengths it keeps. The Spiral dialog sends a typed decay past 99.99 as
99.99, the decay the spiral was already drawn with.
The Arc dialog test now expects OK to refuse a slope outside -100 to 100
and a Base Along other than X or Y, leaving the dialog open and the options
unchanged. The Slope field and its slider keep a typed value within that
range.