javascript - VML non-zero winding -
i trying draw complex polygons html canvas. have decide on either "even-odd" or "non-zero" winding rule. browsers apply non-zero winding rule default. in ie11+ , other major browsers winding rule can changed even-odd.
i want consistent on older browsers (supporting ie8+). since there doesn't seem way change winding rule in ie9 , ie10, asking if there way change winding ie8.
i using excanvas.js ie8. excanvas.js uses vml shapes simulate shapes on canvas , applies even-odd rule default. there way change winding vml shapes non-zero rule?
a fiddle play with.
var canvas = document.getelementbyid("canvas"); var context = canvas.getcontext("2d"); context.beginpath(); context.moveto(111, 108), context.lineto(112, 141), context.lineto(155, 143), context.lineto(140, 171), context.lineto(113, 170), context.lineto(92, 168), context.lineto(80, 142), context.lineto(79, 117), context.lineto(82, 86), context.lineto(103, 75), context.lineto(131, 67), context.lineto(179, 67), context.lineto(177, 55), context.lineto(122, 39), context.lineto(93, 45), context.lineto(60, 57), context.lineto(41, 79), context.lineto(36, 108), context.lineto(43, 149), context.lineto(65, 187), context.lineto(104, 203), context.lineto(146, 206), context.lineto(173, 190), context.lineto(187, 160), context.lineto(195, 115), context.lineto(152, 110) context.closepath(); context.moveto(44, 50), context.lineto(90, 66), context.lineto(61, 27) context.closepath(); // use either nonzero or evenodd //context.fill("nonzero"); //context.fill("evenodd"); context.fill();
<canvas width="250" height="250" id="canvas"></canvas>
even-odd / non-zero
i asking if there way change winding [fill rule] ie8?
the vml standard not allow defining fill-rules even-odd option.
you may around of problems rendering each sub-path separately. of course may introduce other problems in other end when path depends on them final result.
Comments
Post a Comment