How to check if a SkPath will draw anything?

22 views
Skip to first unread message

Sherlock Doyle

unread,
Feb 11, 2024, 5:01:39 AMFeb 11
to skia-discuss
How do you know if a SkPath will show anything when it's filled? For example, if you draw a circle that's radius is bigger than 0 with a fill paint, you'll see something. But if you just draw a line (M0,0 L10,10) with a fill paint, you won't see anything. A curve segment might or might not show, depending on if it's straight or not. This is also true for more complicated paths.

Also, how can you find the bounding box of the fill? For example, the bounding box of the line segment above is (L=0, T=0, R=10, B=10). But its fill bounding box would just be an empty rectangle.

Or, how can you find the area of a path and see if it's 0 or not? This might not be the right way to do it. If you find the signed area, it could be 0 even if the actual filled area isn't 0.
Reply all
Reply to author
Forward
0 new messages