From f01774ab6b26ed017c1626763077f326e761f938 Mon Sep 17 00:00:00 2001 From: Dominik Jain Date: Fri, 28 Nov 2025 16:41:17 +0100 Subject: [PATCH] System prompt: More information on shape positioning (particularly with respect to parent shapes) --- mcp-server/data/prompts.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mcp-server/data/prompts.yml b/mcp-server/data/prompts.yml index 50aab06..976e93b 100644 --- a/mcp-server/data/prompts.yml +++ b/mcp-server/data/prompts.yml @@ -25,7 +25,10 @@ initial_instructions: | * The `Image` type is a legacy type. Images are now typically mostly embedded in a `Fill` with `fillImage` set to an `ImageData` object, i.e. the `fills` property of of a shape (e.g. a `Rectangle`) will contain a fill where `fillImage` is set. - * The location properties `x` and `y` refer to the top left corner of a shape's bounding box. + * The location properties `x` and `y` refer to the top left corner of a shape's bounding box in the absolute (Page) coordinate system. + * When a shape is a child of a parent shape, the property `parent` refers to the parent shape, and the read-only properties + `parentX` and `parentY` (as well as `boardX` and `boardY`) provide the position of the shape relative to its parent (containing board). + To position a shape within its parent, set the absolute `x` and `y` properties accordingly. * The z-order of shapes is, by default, determined by the order in the `children` array of the parent shape. Therefore, when creating shapes that should be on top of each other, add them to the parent in the correct order (i.e. add background shapes first, then foreground shapes later).