From ef5c949d8567b94e68b798a126e619856c9a8d15 Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Sun, 9 Mar 2025 13:00:07 +0200 Subject: [PATCH] Add stub method for isPointInStroke --- .npmignore | 4 ++++ .npmrc | 1 + context.js | 9 +++++++++ package.json | 4 ++-- types/context.d.ts | 2 ++ 5 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 .npmignore create mode 100644 .npmrc diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..0cd9739 --- /dev/null +++ b/.npmignore @@ -0,0 +1,4 @@ +coverage +test +/*.js +!dist \ No newline at end of file diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..0a02f61 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +@icynet:registry=https://git.icynet.eu/api/packages/evert/npm/ \ No newline at end of file diff --git a/context.js b/context.js index 004c1d1..ae078ba 100644 --- a/context.js +++ b/context.js @@ -1218,6 +1218,15 @@ export default (function () { } }; + Context.prototype.isPointInStroke = function (path2d, x, y) { + if (this.__ctx) { + return this.__ctx.isPointInStroke(path2d, x, y); + } + + // TODO: method stub + return false; + } + /** * SetTransform changes the current transformation matrix to * the matrix given by the arguments as described below. diff --git a/package.json b/package.json index 75a5755..4bf8c03 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { "name": "@icynet/svgcanvas", - "version": "2.5.1", + "version": "2.5.1-1", "description": "svgcanvas", "main": "dist/svgcanvas.js", "types": "types/index.d.ts", "scripts": { "watch": "rollup -c -w", "build": "rollup -c", - "prepare": "npm run build", + "prepublishOnly": "npm run build", "test": "karma start" }, "repository": { diff --git a/types/context.d.ts b/types/context.d.ts index d878cac..9e81f43 100644 --- a/types/context.d.ts +++ b/types/context.d.ts @@ -90,4 +90,6 @@ export default class Context { createImageData(): any; putImageData(): any; globalCompositeOperation(): any; + isPointInStroke(x: number, y: number): boolean; + isPointInStroke(path: Path2D, x: number, y: number): boolean; }