peach5460 edited a comment on issue #12851: URL: https://github.com/apache/incubator-echarts/issues/12851#issuecomment-647892763
进一步的问题,伪代码如下: 伪代码 ``` function onShapeDragend(e) { //...获取polygon // 遍历polygon的点,将position叠加上去 for (let index = 0; index < points.length; index++) { points[index][0] = points[index][0] + this.position[0]; points[index][1] = points[index][1] + this.position[1]; } // 替换原来的polygon的点 myChart.setOption({ graphic: [ { id: id, shape: { points: points }, position: [0, 0], }, ], }); } ``` 如果我再dragend事件里,将这个polygon的坐标手动叠加position,然后将position强制设为【0,0】,拖动几次以后,整个echart的基本对象坐标体系就全乱了,polygon再也选不中了(绘制的位置和鼠标拾取的位置不在一个地方)。 ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org