Skip to content

Commit

Permalink
[GraFx Studio] Anchoring 2 (#442)
Browse files Browse the repository at this point in the history
  • Loading branch information
BramVerniest authored Nov 22, 2024
1 parent ef1d434 commit 1a97784
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 28 deletions.
28 changes: 20 additions & 8 deletions docs/GraFx-Studio/concepts/anchoring/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Anchoring

Anchoring lets you attach frames to the **canvas** or to other **frames** in your Smart Template, creating a dynamic layout that adapts to different sizes.
Anchoring lets you attach frames to the **page** or to other **frames** in your Smart Template, creating a dynamic layout that adapts to different sizes.

Imagine placing a logo 10% from the top and 15% from the left of your design—anchoring makes this easy to maintain across varying layouts.

Expand All @@ -14,35 +14,47 @@ Why position a frame relative to the page or another frame? Anchoring is essenti

Anchoring a frame to the **page** is the most straightforward anchoring concept.

This method anchors a frame to a specific side of the page or canvas, usually in a relative position. When you place a frame on the canvas, anchoring records its position relative to the page, so it remains consistent even if the canvas size changes.
This method anchors a frame to a specific side of the page, usually in a relative position. When you place a frame on the page, anchoring records its position relative to the page, so it remains consistent even if the page size changes.

![screenshot-full](anchor02.png)

## Anchor to Frame

Anchoring a frame to **another frame** allows you to set precise relationships between elements.

For example, if a text frame is anchored to a logo frame, the text will maintain the same offset from the logo, even if the page or canvas size changes.
For example, if a text frame is anchored to a logo frame, the text will maintain the same offset from the logo, even if the page size changes or when the position or size of the logo frame changes.

![screenshot-full](anchor03.png)

## Inheritance

Anchoring settings follow the [Inheritance Model](/GraFx-Studio/concepts/layouts/#inheritance) across sublayouts, ensuring consistent positioning.
Anchoring settings follow the [Inheritance Model](/GraFx-Studio/concepts/layouts/#inheritance) across sub-layouts, ensuring consistent positioning.

When creating sublayouts, anchoring maintains relative positions across different canvas sizes. In the example below, a default layout uses a square format where all frames are positioned relative to the page.
When creating sub-layouts, anchoring maintains relative positions across different page sizes. In the example below, a default layout uses a square format where all frames are positioned relative to the page.

![screenshot-full](anchor04.png)

For a landscape sublayout, anchoring automatically adapts frame positions to the new canvas size, preserving the original layout's relative spacing.
For a landscape sub-layout, anchoring automatically adapts frame positions to the new page size, preserving the original layout's relative spacing.

![screenshot-full](anchor05.png)

A vertical sublayout applies the same principle—only the canvas size changes, while the frames maintain their relative positioning.
A vertical sub-layout applies the same principle—only the page size changes, while the frames maintain their relative positioning.

![screenshot-full](anchor06.png)

If you want to make specific adjustments, you can manually move a frame or change the anchoring type. Doing so breaks inheritance with the parent layout, and the new values appear in yellow in the properties panel, indicating overrides.
If you want to make specific adjustments, you can manually move a frame or change the anchoring type.

Doing so breaks inheritance with the parent layout, and the new values appear in yellow in the properties panel, indicating overrides.

When moving a frame, these settings will also override the inheritance model:

- X & Y
- Width & Height
- Rotation
- Horizontal & Vertical anchoring + all its settings
- Auto-grow + all its settings [^1]

[^1]: Available soon! Mentioned here because it will also override inheritance when available.

![screenshot-full](anchor07.png)

Expand Down
39 changes: 19 additions & 20 deletions docs/GraFx-Studio/guides/anchoring/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ The image frame below is anchored to the page by default, with Left and Right se

![screenshot-full](anchor_guide_03.png)

If the canvas size changes (e.g., from 1080 px to 1200 px), the frame's relative position remains the same at 5% from the left and right. However, the actual pixel distance will change:
If the page size changes (e.g., from 1080 px to 1200 px), the frame's relative position remains the same at 5% from the left and right. However, the actual pixel distance will change:

- 5% of 1080 = 54 px
- 5% of 1200 = 60 px

!!! Info "Precision"
The anchors on screen only show full percentages. Behind the screens GraFx Studio calculates with **4** decimals precision.
The anchors on screen show 2 decimals in the percentages. Behind the screens GraFx Studio calculates with full precision.

54.1432% will display as **54%**
54.1432% will display as **54.14%**

54.9876% will display as **55%**
54.9876% will display as **55.99%**

You can still enter the exact pixel location of a frame to start, and the percentages will show on the selected frame. (when set to relative)

Expand All @@ -59,39 +59,39 @@ Selecting these anchors sets the frame to a fixed offset from the chosen side(s)

#### Left

A fixed offset (in pixels, mm, inches, etc.) is set from the left target. If the canvas width changes, the left offset remains constant.
A fixed offset (in pixels, mm, inches, etc.) is set from the left target. If the page width changes, the left offset remains constant.

![screenshot-full](anchor_guide_06.gif)

#### Right

A fixed offset is set from the right target. If the canvas width changes, the right offset remains constant.
A fixed offset is set from the right target. If the page width changes, the right offset remains constant.

![screenshot-full](anchor_guide_07.gif)

#### Left & Right

A fixed offset is maintained on both the left and right sides. If the canvas width changes, both offsets remain unchanged.
A fixed offset is maintained on both the left and right sides. If the page width changes, both offsets remain unchanged.

![screenshot-full](anchor_guide_08.gif)

#### Top

**Note:** Top, Bottom and Top & Bottom are only available.

A fixed offset (in pixels, mm, inches, etc.) is set from the top target. If the canvas height changes, the top offset remains constant.
A fixed offset (in pixels, mm, inches, etc.) is set from the top target. If the page height changes, the top offset remains constant.

#### Bottom

A fixed offset is set from the bottom target. If the canvas height changes, the bottom offset remains constant.
A fixed offset is set from the bottom target. If the page height changes, the bottom offset remains constant.

#### Top & Bottom

A fixed offset is maintained on both the top and bottom sides. If the canvas height changes, both offsets remain unchanged.
A fixed offset is maintained on both the top and bottom sides. If the page height changes, both offsets remain unchanged.

### Center

The selected frame stays centered **relative** to the canvas, and its size does not change if the canvas dimensions change.
The selected frame stays centered **relative** to the target (page or frame), and its size does not change if the page dimensions change.

When moving the frame, it remains positioned relative to the center of the target.

![screenshot-full](anchor_guide_09.gif)

Expand All @@ -103,15 +103,15 @@ You can modify the target by selecting a new option below the Horizontal and Ver

![screenshot](anchor_guide_10.png)

The box with four circles around it represents your frame. The animation next to it shows the effect of your anchor settings. In the animation, the blue box represents your frame, and the gray area represents your canvas.
The box with four circles around it represents your frame. The animation next to it shows the effect of your anchor settings. In the animation, the blue box represents your frame, and the gray area represents your page.

Click the circles (left, top, right, bottom) or the center cross to adjust the anchor settings. Depending on the settings, some anchor targets may be restricted (e.g., if the left side is anchored, the right anchor cannot be set).

![screenshot](anchor_guide_11.png)

## Anchoring effect on a frame

Below, you'll find a [reference overview](#reference-anchoring-effect-on-a-frame) of the effect of changing the canvas or page size to the frame when anchored with specific settings.
Below, you'll find a [reference overview](#reference-anchoring-effect-on-a-frame) of the effect of changing the page size to the frame when anchored with specific settings.

## Anchor to Page

Expand Down Expand Up @@ -142,19 +142,18 @@ The solid anchor line on the left of the house image shows the offset (79.50) an

## Reference: Anchoring effect on a frame

Examples below show the effect of changing the canvas or page size, when a frame is anchored with these settings.
Examples below show the effect of changing the page size, when a frame is anchored with these settings.

<script src="https://unpkg.com/@dotlottie/[email protected]/dist/dotlottie-player.mjs" type="module"></script>

!!! Info "Explained: Center-Bottom"
Let's explain one as example: **Center-Bottom**

Horizontally, the frame is anchored to the center of the page (or canvas).
Horizontally, the frame is anchored to the center of the page.

Vertically, the Frame is anchored to the bottom of the page (or canvas).
Vertically, the Frame is anchored to the bottom of the page.

Now, when you change the canvas size, the distance of the bottom of the frame remains equal. The horizontal posizion will remain centered in the canvas.

Now, when you change the page size, the distance of the bottom of the frame remains equal. The horizontal posizion will remain centered in the page.


| Anchor settings effect | | |
Expand Down

0 comments on commit 1a97784

Please sign in to comment.