efemoney
09/13/2020, 2:57 AMContaner(val painters: List<Painter>): Painter {
override val intrinsicSize = Size(
painters.maxOf { it.width },
painters.sumBy { it.heightRespectingAspectRatio }
)
override fun DrawScope.onDraw() {
var offset = Offset.Zero
painters.fastForEach {
it.??? // :( not sure what to place here, I dont have access to the draw method of the individual painters, how do I tell the painter to draw into the containers canvas
}
}
}
The end goal, if its clear from the Size
calculation, is to create a painter that will place each individual painter, in a vertical column, kinda like stitching images together vertically.
I want to then be able to run transformations on the container painter (scale, pan etc) driven by gestures.Zach Klippenstein (he/him) [MOD]
09/13/2020, 4:54 PMwith(it) { onDraw() }
Nader Jawad
09/16/2020, 1:04 AMwith(it) { childpainter.draw() }
as the onDraw()
method is protected and is part of the implementation but draw()
is part of the public API