Angelo Rüggeberg
07/12/2021, 6:21 AMLocalView
in compose Desktop ?
I am trying to have a code like this in place: LocalView.current.let { IntSize(it.width, it.height) }
Dominaezzz
07/12/2021, 6:40 AMAngelo Rüggeberg
07/12/2021, 7:43 AMpainter.rootViewSize = LocalView.current.let { IntSize(it.width, it.height) }
So basically whats happening is that this code takes the current Image(View) and forewards the rendered size to the imageloader in order to size the requested bitmap for example with the correct sizesjim
07/12/2021, 2:58 PMBoxWithConstraints
get you what you're looking for?Angelo Rüggeberg
07/13/2021, 12:49 PMBoxWithConstraints
to work.
I actually like the approach of getting attributes using some Local provider for the currently active/attached Composable as it enables more flexibility without sticking meta boxes around components.
Here is a perma link to the implementation I am refering to
https://github.com/google/accompanist/blob/767e68368791afc76ac9de4c2976522bbe85096[…]rc/main/java/com/google/accompanist/imageloading/LoadPainter.kt