mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-07-29 23:29:06 -04:00
parent
0fe52a7d39
commit
438de7013a
6 changed files with 64 additions and 44 deletions
src/path
|
@ -309,8 +309,8 @@ var PathItem = Item.extend(/** @lends PathItem# */{
|
|||
/*#*/ if (__options.nativeContains || !__options.booleanOperations) {
|
||||
// To compare with native canvas approach:
|
||||
var ctx = CanvasProvider.getContext(1, 1);
|
||||
// Abuse clip = true to get a shape for ctx.isPointInPath().
|
||||
this._draw(ctx, new Base({ clip: true }));
|
||||
// Use dontFinish to tell _draw to only produce geometries for hit-test.
|
||||
this._draw(ctx, new Base({ dontFinish: true }));
|
||||
var res = ctx.isPointInPath(point.x, point.y, this.getWindingRule());
|
||||
CanvasProvider.release(ctx);
|
||||
return res;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue