Is there a way to align a `DrawVector` inside a co...
# compose
m
Is there a way to align a
DrawVector
inside a container or i need to wrap the
DrawVector
with another container that gets its dimensions from the
vectorAsset
? I feel like I'm missing something.
j
I ran into this same issue. I was told it’s a bug in
DrawVector
(it always draws at the parent 0,0 coordinates) so you have to wrap it in a
Container
with the exact width/height set to the Vector size
m
OK, Double wrapping seems like overkill for a
DrawVector
because it generates 2 layout nodes. After looking at the current implementations i think the way to go is just to write a new component that takes some extra
prams
that just does basic canvas transforms before the draw call.
a
we didn't add this for dev-02 but we work on this right now: https://android-review.googlesource.com/c/platform/frameworks/support/+/1148923. so for now you can wrap with an additional container, yes
👍 1