You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When you make a stacked component and for example use Y, and every time you use SiblingConstraint() with paddings, the space in the parent component reduces, but FillComponent ignores that and uses full size and exceeds the space given by the parent component.
To Reproduce
Steps to reproduce the behavior:
val block =UIBlock().constrain {
y =CramSiblingConstraint(3f)
x =CramSiblingConstraint(3f)
width =100.pixels
height =110.pixels
color =ConstantColorConstraint(VigilancePalette.getDividerDark())
} effect ScissorEffect() childOf scroller
UIImage.ofResource(module.logo).constrain {
x =CenterConstraint()
y =SiblingConstraint(3f) +5f.pixels
width =64.pixels
height =64.pixels
} childOf block
UIText(module.spacedName).constrain {
x =CenterConstraint()
y =SiblingConstraint(10f)
} childOf block
val statusBlock =UIBlock(ConstantColorConstraint(BooleanDefinedColorState(module::state))).constrain {
y =SiblingConstraint()
x =CenterConstraint()
width =100.percent
height =FillConstraint()
} childOf block
UIText("Enabled").constrain {
x =CenterConstraint()
y =CenterConstraint()
} childOf statusBlock
Expected behavior Used hard coded values
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
No paddings:
With paddings:
The text was updated successfully, but these errors were encountered:
I've closed the referenced PR as it has several shortcomings that make it unfit for general use.
If it works in your case, you could just create a local copy of it for your use.
Internally we've come to do something similar but with different tradeoffs than that PR, namely that it accounts for all SiblingConstraint-induced padding (or more generally any PaddingConstraint-induced padding) but not any offset induced in any other way. In particular your y = SiblingConstraint(3f) + 5f.pixels (which, given the aren't any preceding siblings (?) is just 5.pixels) wouldn't work. We've come to instead use dummy spacer components of appropriate size whenever we need extra padding at the very start/end.
Here's the relevant part of FillConstraint (at least the width; height works analogous) which we've modified:
Beware that we only ever use it with useSiblings = true, so that else case is completely untested (and looking at it, idk what that's supposed to do; doesn't look right to me).
Describe the bug
When you make a stacked component and for example use Y, and every time you use SiblingConstraint() with paddings, the space in the parent component reduces, but FillComponent ignores that and uses full size and exceeds the space given by the parent component.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Used hard coded values
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
No paddings:
With paddings:
The text was updated successfully, but these errors were encountered: