mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-01 05:37:23 -06:00
MCP: doc_inspect reports opacityPct in the percent scale the drawing tools take
draw_path, draw_shape and object.setProps take opacity in percent (0-100),
but the document.inspect / document.node summary behind doc_inspect,
inspect_document and vectorcraft://object/{id} reported the stored 0-1
fraction under the same name. An agent that read 0.55 and wrote it back
got a nearly invisible object.
The summary now adds opacityPct (0-100, rounded to 1/100 of a percent)
beside the unchanged opacity, and the tool, resource and command
descriptions say which scale each field uses. Round-trip test in the mcp
crate: draw at 55 %, read 55 back from doc_inspect, inspect_document and
the object resource, write it back unchanged.
This commit is contained in:
+4
-2
@@ -233,8 +233,10 @@ nothing truncated the reply is the plain summary. Both must be non-negative inte
|
||||
|
||||
In the summary an object reports its paint as `fill`, `stroke` (labels) and `strokeWidth`. So does a compound path,
|
||||
whose paint is its own: its member paths report `compoundMember: true` instead of a paint they don't have. Every
|
||||
node (layers and groups too) reports `opacity` when it is below 1 and `blend` when it isn't Normal, as the label
|
||||
`object.setProps {blend}` takes (`"Multiply"`, `"Color Burn"`).
|
||||
node (layers and groups too) reports its opacity when it is below 1, in both scales: `opacity` is the 0–1 fraction
|
||||
the document stores and `opacityPct` the 0–100 % that `object.setProps`, `transparency.set`, `draw_path` and
|
||||
`draw_shape` take (so an agent passes `opacityPct` back, never `opacity`); and `blend` when it isn't Normal, as
|
||||
the label `object.setProps {blend}` takes (`"Multiply"`, `"Color Burn"`).
|
||||
|
||||
On a large document, drill instead of dumping: `inspect_document {depth: 0}` (or `run_command document.inspect
|
||||
{depth?, childLimit?}`, same rules) is the skeleton (artboards with top layers and counts), `run_command
|
||||
|
||||
Reference in New Issue
Block a user