pissang edited a comment on issue #15023: URL: https://github.com/apache/echarts/issues/15023#issuecomment-847510964
@plainheart I thought the first point and the last point has been connected in the `roundRect.ts` helper so there is no need to do `closePath` again, which is an extra cost in the case that drawing lots of rect(like in benchmark.html). But it seems to be a mistake in this case. Also, only the SVG renderer that drawing a rectangle without border-radius will have this issue. Because canvas renderer will use `ctx.rect` command, which is closed underlying automatically. And drawing rectangle with `border-radius` also has no issue because there is an `arc` command connecting the first point and last point, which is like:  So I think what we need is adding an `Z` command when rendering `rect` command in the SVG renderer https://github.com/ecomfe/zrender/blob/da94b645863f50d6975c4c56e3c97f08bd5edd4f/src/svg/graphic.ts#L229 It can keep both performance in the canvas and correctness in the svg -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
