| 1 | ## Element Position and Canvas |
| 2 | |
| 3 | Non-text visual elements use `pos_x` and `pos_y` for precise placement on the canvas, where `(0, 0)` starts at the top-left corner. Text uses `horizon`, `vertical`, and root-level `offset_x`/`offset_y` instead. |
| 4 | |
| 5 | - `flip_x` mirrors horizontally and `flip_y` mirrors vertically, as defined by the current tool schema. |
| 6 | |
| 7 | ## Canvas Size |
| 8 | |
| 9 | ### Initializing the Canvas |
| 10 | |
| 11 | Use `create_project` and `update_project` to initialize or change the canvas size. |
| 12 | |
| 13 | - When calling `create_project`, pass `canvas` only if the user explicitly specifies a canvas size. Otherwise, do not initialize the canvas size proactively. |
| 14 | - A user-specified canvas size takes precedence over scenario constraints and material dimensions. Do not override it because a scenario or material differs unless the user requests a change. |
| 15 | |
| 16 | ### Inferring the Canvas from Context |
| 17 | |
| 18 | Before formal editing, if the user did not specify a canvas size, `update_project` may update the canvas based on context. Apply this priority order: |
| 19 | |
| 20 | 1. If a scenario guide specifies how to set the canvas, determine the canvas from that constraint and the dimensions of the user’s materials. |
| 21 | 2. If no scenario constraint applies and all materials are landscape or all are portrait, default to `16:9` or `9:16`, respectively. |
| 22 | |
| 23 | If only an orientation or aspect ratio is known, with no exact dimensions, refer to [Standard Canvas Sizes](#standard-canvas-sizes). If orientations are mixed and no applicable rule exists, do not force a canvas size; preserve the editor’s behavior of inferring it from added elements. |
| 24 | |
| 25 | After setting a context-derived canvas, tell the user the selected dimensions and rationale in the final response. |
| 26 | |
| 27 | Changing the canvas size does not resize elements. After the change, use `inspect_elements` to read element sizes, positions, and text styles. For video/image elements, use `fit` to adapt them to the canvas. The following is an `edit_element` argument fragment; supply `project_id` when required by the current schema: |
| 28 | |
| 29 | ```json |
| 30 | { |
| 31 | "updates": [ |
| 32 | { |
| 33 | "id": "video-or-image-element-id", |
| 34 | "fit": "contain" |
| 35 | } |
| 36 | ] |
| 37 | } |
| 38 | ``` |
| 39 | |
| 40 | ### Standard Canvas Sizes |
| 41 | |
| 42 | The following dimensions are expressed as width × height. Landscape is `16:9`; portrait is `9:16`: |
| 43 | |
| 44 | - 720P: 1280 × 720 or 720 × 1280. |
| 45 | - 1080P: 1920 × 1080 or 1080 × 1920. |
| 46 | - 4K: 3840 × 2160 or 2160 × 3840. |
| 47 | |
| 48 | ## Vertical and Horizon |
| 49 | |
| 50 | `vertical` is mutually exclusive with `pos_y`, and `horizon` is mutually exclusive with `pos_x`. Use `vertical` and `horizon` for nine-grid layouts. Except for text elements, their calculation depends on both the element dimensions and canvas dimensions. |
| 51 | |
| 52 | New text requires both `horizon` and `vertical`; do not pass `width` or `height` when adding text. |
| 53 | New horizontal text uses 80% of the canvas width; new vertical text uses 80% of the canvas height. |
| 54 | Updates do not reapply these defaults; follow the [text guide](edit-text.md) for supported size changes. |
| 55 | Semantic text placement automatically keeps a |
| 56 | 10 px safe inset on every Canvas edge, and offsets cannot move the result out of bounds. Non-text |
| 57 | elements continue to use the full Canvas for placement calculations. |
| 58 | |
| 59 | ## Canvas Placement with `fit` |
| 60 | |
| 61 | - `fit` applies only to video/image elements. Do not pass it for text, audio, effects, LUTs, or transitions. |
| 62 | |
| 63 | `fit` places video/image elements according to the canvas and source material dimensions. Use `contain` to show the complete source or `cover` to fill the canvas with cropping. New video/image elements default to `contain` when no dimensions, position, or alignment are supplied. Do not combine `fit` with `width`, `height`, `pos_x`, `pos_y`, `horizon`, or `vertical`. |
| 64 | |
| 65 | ## Rotation |
| 66 | |
| 67 | `rotation` uses degrees in the range -360 to 360; positive values rotate clockwise around the element center. |
| 68 |