From 21484e03951dd8db960ddcb6a773afb58785dbd2 Mon Sep 17 00:00:00 2001 From: yaoyuchi Date: Thu, 31 Mar 2022 16:57:57 +0800 Subject: [PATCH] canvas add filter and isptin Signed-off-by: yaoyuchi --- api/@internal/component/ets/canvas.d.ts | 38 +++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/api/@internal/component/ets/canvas.d.ts b/api/@internal/component/ets/canvas.d.ts index 37f1a30ba6..f2454fdb74 100644 --- a/api/@internal/component/ets/canvas.d.ts +++ b/api/@internal/component/ets/canvas.d.ts @@ -669,7 +669,7 @@ declare class CanvasRenderer extends CanvasPath { * none:Turn off filter effects * @since 8 */ - filter(filter: string): void; + filter: string; /** * Creates a new, empty ImageData object of the specified size @@ -697,6 +697,40 @@ declare class CanvasRenderer extends CanvasPath { */ getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; + /** + * is a point in path + * @param x position + * @param y position + * @since 9 + */ + isPointInPath(x: number, y: number): boolean; + + /** + * is a point in path2D + * @param path path2D + * @param x position + * @param y position + * @since 9 + */ + isPointInPath(path: Path2D, x: number, y: number): boolean; + + /** + * is a point in stroke + * @param x position + * @param y position + * @since 9 + */ + isPointInStroke(x: number, y: number): boolean; + + /** + * is a point in stroke path2D + * @param path path2D + * @param x position + * @param y position + * @since 9 + */ + isPointInStroke(path: Path2D, x: number, y: number): boolean; + /** * Obtains the PixelMap of a specified area on the current canvas. * @param sx x coordinate of the upper left corner of the rectangular area of the PixelMap to be extracted. @@ -712,7 +746,7 @@ declare class CanvasRenderer extends CanvasPath { * @param imagedata ImageData object to be drawn. * @param dx Position offset of the source image data in the target canvas (the offset in the x-axis direction). * @param dy Position offset of the source image data in the target canvas (the offset in the y-axis direction). - * @since 8 + * @since 9 */ putImageData(imagedata: ImageData, dx: number, dy: number): void; -- Gitee