mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-14 19:26:56 -04:00
Fix #381: round single corners with Direct Selection (per-corner Live Corners)
A live rectangle stored four corner radii but drew them all with the largest, and the corner widgets always rounded all four corners, so one corner could not be rounded on its own. - geom: rectangle_with_corners draws each corner with its own radius and kind (Round, Inverted Round, Chamfer); a sharp corner is one anchor, a cut one two. Uniform corners keep the exact rounded-rectangle anchors. - doc: LiveShape::Rectangle gains `kinds` (saved only when a corner isn't round; older files read as round), plus helpers mapping anchors to corners. - engine: object.setLiveShape takes `corners` and `kind`; without `corners` it edits the Direct-Selected corners, else all four, and keeps the selected corners selected as their anchors change. - tools: with Direct Selection, only the selected corners show widgets and a drag rounds just those; Alt-click cycles the corner kind; double-click opens the new Corners dialog (also `ui.corners`). - ui: Properties/Transform radius fields show and set the selected corners; CSS export keeps per-corner radii and skips cut-in corners. - docs: mcp.md (Live Corners), control-protocol.md (Corners dialog), ROADMAP. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
3585ef654c
commit
b05c14f8eb
28 files changed
+817
-80
No files matched your search
@@ -253,6 +253,11 @@ Width Point Edit: double-clicking a width point with the Width tool, or `ui.widt
|
||||
`adjustAdjoining`). `ui.dialog.confirm` runs `stroke.widthPoint.set` with them; `ui.dialog.set {field: "discard",
|
||||
value: true}` then confirm (the Delete button) removes the point with `stroke.widthPoint.remove`.
|
||||
|
||||
Corners: double-clicking a Live Corners widget with the Selection or Direct Selection tool, or `ui.corners {id?,
|
||||
corners?}`, opens the `corners` dialog for a live rectangle's corners (the Direct-Selected ones, else all four; fields
|
||||
`id`, `corners`: indices 0–3 clockwise from the top-left, `kind`: round, invertedRound or chamfer, `radius` in points;
|
||||
`kind` or `radius` is absent while the corners differ). `ui.dialog.confirm` runs `object.setLiveShape` with them.
|
||||
|
||||
Perspective plane options: double-clicking a plane widget of the perspective grid, or `ui.perspectivePlane {plane}`,
|
||||
opens the `perspectivePlane` dialog (fields `plane`: left, right or ground; `location`: points along the plane's
|
||||
normal; `objects`: none, move or copy). `ui.dialog.confirm` runs `perspective.plane.move` with them.
|
||||
|
||||
+16
@@ -1039,6 +1039,22 @@ size. The journal entry of a scaling command records the `strokes` and `corners`
|
||||
{"name":"run_command","arguments":{"command":"object.transformEach","params":{"scaleH":50,"scaleV":50,"strokes":false}}}
|
||||
```
|
||||
|
||||
## Live Corners
|
||||
|
||||
`object.setLiveShape {id?, ids?, radius?, kind?, corners?}` sets the corners of live rectangles (one undo step):
|
||||
`radius` (pt) and `kind` (`round`, `invertedRound` or `chamfer`) go to the `corners` given (0 top-left, 1 top-right,
|
||||
2 bottom-right, 3 bottom-left), else to the corners holding a Direct-Selected anchor (`select.anchors`), else to all
|
||||
four. Each corner keeps its own radius and kind (the shape's `live` in queries has `radii` and, when a corner isn't
|
||||
round, `kinds`); a corner with no radius is one anchor, a cut one two, and Direct-Selected corners stay selected as
|
||||
that changes. With the Selection or Direct Selection tool, dragging a corner widget rounds the corners whose widgets
|
||||
show (all four, or the Direct-Selected ones), Alt-clicking one cycles their kind and double-clicking one opens Corners
|
||||
(`ui.corners {id?, corners?}`, dialog `corners`: `kind`, `radius`; OK runs `object.setLiveShape`).
|
||||
|
||||
```json
|
||||
{"name":"run_command","arguments":{"command":"object.setLiveShape","params":{"id":12,"corners":[1],"radius":16}}}
|
||||
{"name":"run_command","arguments":{"command":"object.setLiveShape","params":{"id":12,"corners":[0,3],"radius":8,"kind":"chamfer"}}}
|
||||
```
|
||||
|
||||
## Use Preview Bounds
|
||||
|
||||
With the preference `usePreviewBounds` on (`prefs.set {key: "usePreviewBounds", value: true}`; also the Align panel
|
||||
|
||||
Reference in new issue
Block a user