Closed jtietema closed 7 years ago
I'll rethink my approach, and good points.
Note that you don't need a SharpDrawable for your canvas; I'd suggest using a SharpPicture instead since the drawable is only really a wrapper.
On Fri, Feb 3, 2017, 03:36 Jeroen Tietema notifications@github.com wrote:
To get a SharpDrawable you need to pass a View instance for the sole purpose, that the SharpDrawable can "prepare" that View. That doesn't make much sense if you don't want to pass that SharpDrawable to a View. In my case I would like to use it to render to a Canvas, so now I am forced to instantiate a View just to satisfy the API parameters and then throw it away.
Maybe it would make more sense to "prepare" the View in the Sharp#into() method?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Pixplicity/sharp/issues/33, or mute the thread https://github.com/notifications/unsubscribe-auth/AARdY4E8BMzU86bZPHKAsl0Ysd1iZiB6ks5rYpK5gaJpZM4L15Xh .
I see, but that means I have to make a special exception for the drawing of an SVG. It would be nice if can just draw it as any other Drawable
😉
Note that you can safely provide null as the view argument for the SharpDrawable constructor.
Resolved in 1.1.0.
To get a
SharpDrawable
you need to pass aView
instance for the sole purpose, that theSharpDrawable
can "prepare" thatView
. That doesn't make much sense if you don't want to pass thatSharpDrawable
to aView
. In my case I would like to use it to render to aCanvas
, so now I am forced to instantiate aView
just to satisfy the API parameters and then throw it away.Maybe it would make more sense to "prepare" the
View
in theSharp#into()
method?