Merge pull request #8976 from dotCooCoo/fix/smooth-region-rejects-bad-params

Smooth: path.smoothRegion and path.joinScrub refuse a radius, fidelity or tolerance out of range
This commit is contained in:
BFlat
2026-11-22 11:37:54 +07:00
committed by GitHub
8 changed files with 177 additions and 14 deletions
+8
View File
@@ -7112,6 +7112,14 @@ VectorCraft's own values.
`` `width` must be from 0.001 to 1000 ``. The document and the selection do not change and no undo step is recorded.
Left out or null, `width` is 8 pt. The range is VectorCraft's own value.
`path.smoothRegion` (the Smooth tool) refuses a `radius` outside 0.001 to 1000 pt with
`` `radius` must be from 0.001 to 1000 `` and a `fidelity` outside 0.000078125 to about 3195 pt (the Smooth tool's
0.05 to 100 px at the highest and the lowest zoom) with `` `fidelity` must be from 0.000078125 to 3194.8881789137376 pt ``.
`path.joinScrub` (the Join tool) refuses a `tolerance` outside 0.001 to 1000 pt with
`` `tolerance` must be from 0.001 to 1000 ``. The document and the selection do not change and no undo step is
recorded. Left out or null, `radius` is 12 pt, `fidelity` is 2.5 pt and `tolerance` is 12 pt. The tools send these in screen
pixels divided by the zoom, kept within the ranges. The `radius` and `tolerance` ranges are VectorCraft's own values.
These commands refuse a string, a number or another value that is not true or false with
`` `closed` must be true or false ``, naming the key; the document does not change and no undo step is recorded:
`independent` in `path.close` and `path.setHandle`; `symmetric` and `link` in `path.setHandle`; `patterns` in `path.moveAnchors`; `closed`, `keepSelected` and
+1
View File
@@ -1467,6 +1467,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
Eraser Tool Options has Angle and Roundness besides Size, as [Erase paths using the Eraser tool](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-paths/erase-paths-using-eraser-tool.html) describes: the Eraser's tip is an ellipse Size across, its long axis at Angle and its short axis Roundness percent of the long one, and a drag with a tip that is not round shows the outline of the area it erases (`path.eraseRegion` `angle` and `roundness`).
`path.eraseRegion` refuses an Angle outside −180° to 180° and a Roundness outside 1% to 100% with an error and leaves the document unchanged; a key left out or null takes its default (0° and 100%). The help page gives no range for the two options, so the ranges are VectorCraft's own values. `path.split` refuses a `t` outside 0 to 1 in the same way.
`path.eraseSegments` (the Path Eraser) refuses a `width` outside 0.001 to 1000 pt with an error and leaves the document unchanged; left out or null, the width is 8 pt. The help page gives the Path Eraser no width option, so the range is VectorCraft's own value.
`path.smoothRegion` (the Smooth tool) refuses a `radius` outside 0.001 to 1000 pt or a `fidelity` outside 0.000078125 to about 3195 pt with an error naming the key, and `path.joinScrub` (the Join tool) refuses a `tolerance` outside 0.001 to 1000 pt the same way; the document does not change; before, a radius or tolerance below 0 was read as 0 and a fidelity was moved into its range. Left out or null, the defaults stay (12 pt, 2.5 pt and 12 pt), and the tools keep what they send within the ranges at any zoom. The radius and tolerance ranges are VectorCraft's own values (engine `smooth_and_join_refuse_a_reach_or_fidelity_outside_its_range`).
Eraser Tool Options gives Angle, Roundness and Size each a menu of Fixed, Random, Pressure, Tilt, Bearing and Rotation with a Variation field, as the same page describes: the tip varies by up to the Variation either way, Random once per drag and the others with what the pen reads at each point of the drag, and the tip outline at the pointer follows the pen while it erases. The outline of the area a drag shows takes, at each step, the tip the pen's readings give halfway along it, with a Random value shown as the value itself, and a mouse drag erases at the set values (`path.eraseRegion` `angleMode`, `roundnessMode`, `sizeMode` and their variations).
Eraser Tool Options show the Blob Brush's tip preview under the Roundness rows. A drag on the arrowhead turns the Angle, and a drag that starts on a black dot moves it toward the center for a flatter tip or away from it for a rounder one, as the Eraser tool options section of the [help page](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=133) describes; the fields show the new values, and OK keeps them. The drag's mapping and the Angle and Roundness sliders are the Blob Brush preview's, which are VectorCraft's own, with the Eraser's Roundness range of 1% to 100% for the drag and the keys. The preview shows the set Angle and Roundness, not a Random or pen-driven variation of them. Regression tests: `dialogs::tests::the_eraser_tip_preview_sets_the_angle_and_roundness_by_dragging`, `dialogs::freehand::tests::a_roundness_dot_keeps_the_eraser_at_one_percent_or_more`.
The outline a Blob Brush or Eraser drag shows is built a bounded amount per frame, so a long stroke does not slow the canvas: each frame takes at most 256 new points of the drag and outlines again only the pieces of up to 32 segments they change, and the parts of a piece's outline inside the rest of the area are removed a limited amount at a time. While work is left, the canvas draws again with the pointer still, the points not outlined yet show as a thin line, and the tip shows at the pointer. When the tip varies with the pen (Size set to Pressure, or an Eraser mode that follows the pen), each step is its own piece and the outline also shows only the edge of the whole area. The release sends the whole stroke as before (`path.blob`, `path.eraseRegion`).