Texture
Texture copied to clipboard
ASTextNode text is overflowed whereas left padding is given
Why ASTextNode is overflowing instead of truncating…
HStackLayout(alignItems: .center) {
img1.preferredSize(.init(width: 20, height: 20)).padding(.left, 9)
img2.preferredSize(.init(width: 20, height: 20))
textNode.padding(.left, 6)
}
You need to set style.flexShrink
not equal to 0 for your padding
.
Example without style.flexShrink
:
Row {
imageNode1
.sized(CGSize(same: 20))
.padding(.left(9))
imageNode2
.sized(CGSize(same: 20))
textNode
.padding(.horizontal(6))
}
Example with style.flexShrink
:
Row {
imageNode1
.sized(CGSize(same: 20))
.padding(.left(9))
imageNode2
.sized(CGSize(same: 20))
textNode
.padding(.horizontal(6))
.flex(shrink: 0.1)
}
And with textNode.maximumNumberOfLines = 1
: