Skip to content

Commit

Permalink
Merge pull request godotengine#99915 from bruvzg/lbl_width
Browse files Browse the repository at this point in the history
[Label] Fix min. width
  • Loading branch information
akien-mga committed Dec 2, 2024
2 parents 715a7ba + e8f3beb commit eefd32b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scene/gui/label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,11 @@ void Label::_shape() const {
bool lines_hidden = visible_lines > 0 && visible_lines < total_line_count;

int line_index = 0;
if (autowrap_mode == TextServer::AUTOWRAP_OFF) {
minsize.width = 0.0f;
}
for (Paragraph &para : paragraphs) {
if (autowrap_mode == TextServer::AUTOWRAP_OFF) {
minsize.width = 0.0f;
for (const RID &line_rid : para.lines_rid) {
if (minsize.width < TS->shaped_text_get_size(line_rid).x) {
minsize.width = TS->shaped_text_get_size(line_rid).x;
Expand Down

0 comments on commit eefd32b

Please sign in to comment.