panalink.blogg.se

Svg icon android studio
Svg icon android studio













svg icon android studio

The icon generated from Sketch uses the fill-rule “evenodd” property. Now I sensed that this “fill-rule” property might be the reason for the disappearing hole.Īfter reading some more articles about it, I confirmed the issue. If the number is odd, the point is inside the shape and so that area is filled with color. If the number is even, the point is outside and so that area should not be filled. Count the number of times that imaginary line intersects with the path segments. That imaginary line would intersect the path segments of the shape. To find whether a point in the canvas will be filled or not, draw an imaginary line from that point through the entire shape in any direction. what algorithm to use to determine whether to fill the shape with the color or not. The fill-rule property: This property indicates what algorithm to use to determine what parts of the canvas are included inside more complex shapes. But there wasn’t any direct solution mentioned there, it simply said to use “nonzero” instead of “evenodd”, and I hadn’t the slightest idea about either of those.Īfter a bit of research on Raster graphics, Vector graphics, SVGs, the “evenodd” vs “nonzero” fill-rule property, I made a note about those properties: Then I googled it and found an issue had been filed in AOSP, that VectorDrawable wasn’t supporting evenodd, and the holes were getting disappeared from the icons. I remembered reading something about this “evenodd” in the documentation. There I got a nice warning: “found attribute ‘fill-rule:evenodd’ which is supported only on Android API 24 and higher”.

svg icon android studio

I used an online tool to convert the SVG to VectorDrawable. Then I thought Android Studio would have messed up the icon while importing. I read the VectorDrawable documentation again and then read a few articles about how to use it. What the is this, I thought and closed the editor. I opened that SVG icon using Text Editor and found a lot of numbers with a few alphabets thrown here and there. A new mystery to solve, I thought to myself. I had no idea how the hole got disappeared only in the app. “I will look into this issue,” I mumbled, and left the place confused. She looked at me, with one of her eyebrows raised, and a smirk in her face. She opened her sent emails and showed the email she had sent, and that icon had the hole, too. Then perhaps you sent me a wrong icon,” I said, without giving up. The icon the designer has - there is a hole at the top















Svg icon android studio