Hello, I get a weird behaviour with `simpleLayout`...
# doodle
c
Hello, I get a weird behaviour with
simpleLayout
code in thread
Copy code
simpleLayout { container ->
val view = container.children.first()
                    println("Container=${container.size}")

view.bounds = Rectangle(0.0,0.0, container.width,container.height)
}
The above code makes the view match the container width, but not the container height
Is that intended?
n
The view should adopt both the width and height based on your snippet, and here is a simple app that shows this.
Copy code
display += container {
    children += view {
        render = { rect(bounds.atOrigin, fill = Red.paint) }
    }

    layout = simpleLayout { container ->
        val view = container.children.first()

        view.bounds = Rectangle(0.0,0.0, container.width - 5, container.height - 5)
    }

    render = { rect(bounds.atOrigin, fill = Lightgray.paint) }

    size = Size(100)
    Resizer(this)
}
Are you sure you don't have some other logic (in the view itself, or outside this layout block) that modifies the view's height?
c
You are right. The parent was not matching the its own parent. Thanks