HTML5 Canvas的事件处理 · Dx.Yang

Tags
htmlwebapi
Created
May 10, 2016 3:19 PM

isPointInPath 方法仅能识别当前上下文环境里的图形路径,而之前绘制的路径,无法回溯判断。这种问题的解决方法是:当点击事件发生时,重绘所有图形,每绘制一个就使用 isPointInPath 方法,判断事件坐标是否在该图形覆盖范围内。

SuperMade with Super