You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/05/25 04:00:19 UTC

[GitHub] [echarts] pissang commented on issue #15023: Grid border not closed at left-top corner (no z in SVG path)

pissang commented 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:
   
   ![image](https://user-images.githubusercontent.com/841551/119437249-51a91180-bd50-11eb-9837-475d6eaf3397.png)
   
   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


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org