-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I draw a shape with an inner hole ? #158
Comments
Hi @sotex, |
Hi @llgcode, I have a little question, and I hope to get your guidance. Data are as follows: {"type":"FeatureCollection","features":[{"type":"Feature","properties":{"stroke":"#0f2f9b","stroke-width":2,"stroke-opacity":1,"fill":"#a90501","fill-opacity":0.5},"geometry":{"type":"Polygon","coordinates":[[[100.2392578125,34.34343606848294],[97.998046875,30.41078179084589],[101.22802734375,27.702983735525862],[108.08349609375,28.844673680771795],[110.36865234374999,34.66935854524543],[112.8515625,35.209721645221386],[112.47802734375,31.89621446335144],[117.0703125,30.240086360983426],[117.57568359374999,34.939985151560435],[112.236328125,38.35888785866677],[100.2392578125,34.34343606848294]],[[101.05224609374999,32.02670629333614],[102.72216796875,33.394759218577995],[104.94140625,32.11980111179328],[103.38134765625,31.70947636001935],[103.1396484375,30.259067203213018],[101.05224609374999,32.02670629333614]],[[106.962890625,35.263561862152095],[110.7861328125,36.756490329505176],[111.09374999999999,36.27970720524017],[107.46826171874999,34.74161249883172],[106.962890625,35.263561862152095]]]}},{"type":"Feature","properties":{"stroke":"#ffffff","stroke-width":2,"stroke-opacity":1,"fill":"#ffff00","fill-opacity":0.5},"geometry":{"type":"Polygon","coordinates":[[[113.97216796875,35.99578538642032],[113.9501953125,35.22767235493586],[115.81787109375,34.63320791137959],[115.55419921875,31.522361470421437],[116.23535156249999,31.409912194070973],[116.4111328125,34.88593094075317],[113.97216796875,35.99578538642032]]]}}]} This is the result I draw following the wiki. I think it is better to handle the overlay of the newly filled part with the original color, rather than simply covering it. |
HI @sotex , |
HI @llgcode , |
I need to draw some shapes with inner holes. I don't know if there is a more convenient way.
Because I want to draw multiple such shapes on top of each other.
The method I currently use is:
1、Create a new canvas(Transparent background), Draw upper shell polygon.
2、Draw inner holes in transparent colors
3、Draw the contents of the new canvas onto the old canvas
Thanks.
The text was updated successfully, but these errors were encountered: