Open AdamHarte opened 2 weeks ago
It seems to be an issue since this commit, but that maybe just exposed the issue more: 225c25b0a136e4c7498024dafbba5755741a4ff6
hmmm, interesting... this is haxeui-flixel, correct?
hmmm, interesting... this is haxeui-flixel, correct?
Yes, that is correct. I am currently working around it with the "+4" mentioned in the main description.
When I change the theme in my app at runtime, some of my labels resize to having one character per line. It is not all labels, and seems to be related to having a space character, or maybe its just when the words wrap.
Default, before theme change:
After clicking button to change theme:
I have specifically using HaxeUI with Flixel, and targeting Flash (AIR). running with
lime test flash
I made a minimal reproduction of the issue, starting from the haxeui flixel template:
haxelib run haxeui-core create flixel
. Then a custom layout, with a function to change the theme.It looks like the buttons must have a fixed width for the error to happen.
Potential Fixes
I did find that the Label component in haxeui-core has an override of the
calcAutoSize
function. The Button calls this from itsresizeChildren
function when the theme changes. When I add a "+4" to the following line incalcAutoSize
, it seems to fix my issue.I know Flash always had issues with this textWidth (and textHeight) properties, and needed a buffer like this when using ActionScript. But I am not sure if this is a good final solution.
My example project: HaxeUIThemes.zip
Environment
OS: Windows 10
Haxe: 4.3.6
flixel: 5.8.0
haxeui-core: Latest Git (3ab5f92aedcd128c613582cfb05092f2f9b395a8)
haxeui-flixel: Latest Git (https://github.com/haxeui/haxeui-flixel/commit/7d9b1af2061df47a9659e8c7445e468e61e81cf1)
openfl: 9.4.0
lime: 8.2.0
Flex: 4.16.1
AIR: 51.1.2.1 HaxeUIThemes.zip