Description
Godot version
v4.1.stable.official [9704596]
System information
Godot v4.1.stable - Windows 10.0.22621 - Vulkan (Forward+) - dedicated AMD Radeon RX 7900 XTX (Advanced Micro Devices, Inc.; 31.0.21001.45002) - AMD Ryzen 7 7700X 8-Core Processor (16 Threads)
Issue description
When using CheckBoxes and CheckButtons, the text is able to go beyond node bounds if Text Overrun Behavior is set to any option other than "Trim Nothing", seemingly because it does not account correctly for the space taken by the icon integrated in these two types of Nodes.
The expected behavior is that the text never leaves the Node Size bounds nor overlaps with the icon that is part of the CheckBox or CheckButton. It's alignment and trimming all occur within the expected bounds.
Steps to reproduce
- Create a CheckBox or CheckButton node.
- Within the Node Properties: Button/Text Behavior/Text Overrun Behavior. Set to anything other than "Trim Nothing".
- Write text in the button until it fills its width entirely, triggering the "trimming". Resizing the button for better visibility is recommended.
It should be visible how the text either:
A) Goes beyond the node's bounds (size).
or
B) Overlaps with the icon of the CheckBox or CheckButton, depends on the button used for reproduction.
Which of these two cases occur depends on the text alignment and the type of button chosen, but both are caused by the same issue: trimming not accounting for the integrated icon of CheckBox and CheckButton.