Closed ickshonpe closed 2 weeks ago
Is this just the fault of required components? I don't love hacking around that :/
Is this just the fault of required components? I don't love hacking around that :/
Yeah, it feels really unpleasant. I'm not very happy with any of the image node changes but I've just done whatever was needed to get the new design with required components to work.
Objective
ButtonBundle
has anImageNode
component (renamed fromUiImage
) which wasn't a problem in 0.14 but in 0.15requires
pulls in theContentSize
andNodeImageSize
which means that by defaultButtonBundle
nodes are given a measure func based on the size of the image belonging toTRANSPARENT_IMAGE_HANDLE
, which is 1x1.This doesn't make sense and the behaviour for default image nodes should either be to go to zero size or not add a measure func.
Solution
Check if an image has a
TRANSPARENT_IMAGE_HANDLE
and if it does remove its measure func.Possibly a zero-sized measure would make more sense, but that would break existing code.
Testing
Used
ButtonBundle
in the 0.15button
example and the border doesn't render, after this change it does.