godotengine / godotengine/godot-docs

Clarify set_anchors_preset behavior and remove wrong editor comparison

Open
#11,752 1 comment 1 reaction 0 assignees View on GitHub
area:class reference bug
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

**Godot version:** 4.6

**Issue description:**
The current documentation for Control.set_anchors_preset states that it is the "code equivalent to using the Layout menu in the 2D editor." This comparison is is wrong since by default (keep_offsets: bool = false) control's position is not updated nor their growth, while it is updated using the Layout menu in the 2D editor.

**Original text:**
set_anchors_preset(preset: LayoutPreset, keep_offsets: bool = false)
Sets the anchors to a preset from Control.LayoutPreset enum. This is the code equivalent to using the Layout menu in the 2D editor.
If keep_offsets is true, control's position will also be updated.

**Proposed text:**
set_anchors_preset(preset: LayoutPreset, keep_offsets: bool = false)
Sets the anchors to a preset from Control.LayoutPreset enum. By default, the control's position is not updated.
If keep_offsets is true, the control's position will be updated.

**URL to the documentation page:** https://docs.godotengine.org/en/stable/classes/class_control.html#class-control-method-set-anchors-preset

This change was proposed by @groud in https://github.com/godotengine/godot/pull/92777

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.