DrawablePath and setBoundsToFit()


Just wanted to say:

The function setBoundsToFit() does not work with a DrawablePath object. You can call the function, but nothing happens.

Not sure if it is supposed to be that way. Or maybe I am doing something wrong?

Now I am using setTransformToFit() instead, which works fine. It does what you expect: putting and scaling the DrawablePath in the bounds, which you pass to the function.


Hi Alatar,

setBoundsToFit will just call setBounds internally (after manipulating the rectangle to keep the aspect-ratio and justification) and calling setBounds doesn't really make sense for a drawable. The idea of drawables is that it will always calculate it's own bounds depending on their content. This means you effectively set the bounds with setPath.