You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in renderPolygon method of the canvasRender class:
// clip of poly if all vertices have been marked for clipping
var clippoly = 1;
for (var i=0; i<vertices.length; i++) {
// console.log(clip)
clippoly &= clip[vertices[i]];
}
if (clippoly) return;
there are cases that all vertices have been marked but still be visible in the canvas:
I think it's a hack that i add the condition whether 4 corners of canvas are in the current path or not:
// HACK: all vertices have been marked but still be visible nearby the 4 corners of the canvas
var width = this.canvas.width;
var height = this.canvas.height;
if(ctx.isPointInPath(0, 0) || ctx.isPointInPath(0, height)
|| ctx.isPointInPath(width, 0) || ctx.isPointInPath(width, height)){
clippoly = 0;
}
if (clippoly) return;
do you have some more elegant solutions?
The text was updated successfully, but these errors were encountered:
in
renderPolygon
method of thecanvasRender
class:there are cases that all vertices have been marked but still be visible in the canvas:
I think it's a hack that i add the condition whether 4 corners of canvas are in the current path or not:
do you have some more elegant solutions?
The text was updated successfully, but these errors were encountered: