https://kotlinlang.org logo
#compose
Title
# compose
v

Vivek Sharma

03/04/2021, 5:08 PM
I am not able to create and pass param of
size of custom width or height
in
Canvas
, while drawing Rect I am hacking it like taking whole canvas size using
size
which gives me Canvas size and then doing
size.copy(customWidth, customHeight)
prev there was Size() function but cant access it now? how can I make size of custom width or height?
s

Se7eN

03/04/2021, 5:35 PM
I can access the
Size()
in
beta01
. The import is
import androidx.compose.ui.geometry.Size
v

Vivek Sharma

03/04/2021, 5:42 PM
I am able to access compose
Size
, but only
Class
, not function where I can pass width and height, but there is function
only class, dont konw why
see no fun
s

Se7eN

03/04/2021, 6:26 PM
That's strange. Did you try compiling anyway?
v

Vivek Sharma

03/04/2021, 6:26 PM
no maybe I should try
s

Se7eN

03/04/2021, 6:27 PM
Yeah
v

Vivek Sharma

03/04/2021, 6:30 PM
XD it works,
Compose/Android things
thanks
1
android dance 1
3 Views