From bc55bb89c0f47c61052808057048db19e366578b Mon Sep 17 00:00:00 2001 From: wujinhui Date: Thu, 21 Aug 2025 20:14:14 +0800 Subject: [PATCH] frame ndoe add func convertPoint Signed-off-by: wujinhui --- api/arkui/FrameNode.d.ts | 17 +++++++++++++++++ api/arkui/FrameNode.static.d.ets | 15 +++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/api/arkui/FrameNode.d.ts b/api/arkui/FrameNode.d.ts index 6342ee2cab..e29361bf18 100644 --- a/api/arkui/FrameNode.d.ts +++ b/api/arkui/FrameNode.d.ts @@ -1169,6 +1169,23 @@ export class FrameNode { * @since 20 */ isTransferred(): boolean; + + /** + * Converts a point's coordinates from the current node's coordinate system + * to the target node's coordinate system. + * + * @param { Position } position - The point's coordinates in the current node's local coordinate system. + * @param { FrameNode } targetNode - The destination node whose coordinate system will be used + * for conversion. + * @returns { Position } The converted coordinates in the target node's local coordinate system. + * @throws { BusinessError } 100024 - The current FrameNode and the target FrameNode do not have a common ancestor node. + * @throws { BusinessError } 100025 - The parameter is invalid. The error message provides specific details about which parameter is invalid and why, e.g., "The parameter 'targetNode' is invalid: it cannot be disposed". + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 22 + */ + convertPoint(position: Position, targetNode: FrameNode): Position; } /** diff --git a/api/arkui/FrameNode.static.d.ets b/api/arkui/FrameNode.static.d.ets index 7d01d7afda..faf66109fd 100644 --- a/api/arkui/FrameNode.static.d.ets +++ b/api/arkui/FrameNode.static.d.ets @@ -714,6 +714,21 @@ export declare class FrameNode { * @since 20 */ isTransferred(): boolean; + + /** + * Converts a point's coordinates from the current node's coordinate system + * to the target node's coordinate system. + * + * @param { Position } position - The point's coordinates in the current node's local coordinate system. + * @param { FrameNode } targetNode - The destination node whose coordinate system will be used + * for conversion. + * @returns { Position } The converted coordinates in the target node's local coordinate system. + * @throws { BusinessError } 100024 - The current FrameNode and the target FrameNode do not have a common ancestor node. + * @throws { BusinessError } 100025 - The parameter is invalid. The error message provides specific details about which parameter is invalid and why, e.g., "The parameter 'targetNode' is invalid: it cannot be disposed". + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 22 + */ + convertPoint(position: Position, targetNode: FrameNode): Position; } /** -- Gitee