Skip to content

FillConstraint ignores paddings by SiblingConstrains #127

@semenishchev

Description

@semenishchev

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

Снимок экрана 2023-10-11 в 20 26 17

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
No paddings:
No paddings
With paddings:
Paddings

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions