Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions haxe/ui/components/Label.hx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,14 @@ private class LabelLayout extends DefaultLayout {
public override function calcAutoSize(exclusions:Array<Component> = null):Size {
var size:Size = super.calcAutoSize(exclusions);
if (component.hasTextDisplay() == true) {
#if (haxeui_flixel || haxeui_openfl)
// 2025.04 Seems There's a bug in openfl where once the width has been set for a label
// correct value for TextWidth cannot be reported.
size.width += component.getTextDisplay().measureTextWidth();
#else
size.width += component.getTextDisplay().textWidth;
#end

size.height += component.getTextDisplay().textHeight;
}
return size;
Expand Down