Skip to main content

OH_ArkUI_NativeModule_ConvertPositionToWindow

Function OH_ArkUI_NativeModule_ConvertPositionToWindow 

Source
pub unsafe extern "C" fn OH_ArkUI_NativeModule_ConvertPositionToWindow(
    currentNode: ArkUI_NodeHandle,
    localPosition: ArkUI_IntOffset,
    windowPosition: *mut ArkUI_IntOffset,
) -> i32
Available on crate features api-12 and api-23 only.
Expand description

Converts a point’s coordinates from the target node’s coordinate system to the current window’s coordinate system, with consideration of the node’s transformation.

§Arguments

{ArkUI_NodeHandle} currentNode ArkUI_NodeHandle The target node.

{ArkUI_IntOffset} localPosition The point’s coordinates in the target node’s local coordinate system, in px.

{ArkUI_IntOffset*} windowPosition The converted coordinates in the current window’s coordinate system, in px.

§Returns

  • Error code. [ARKUI_ERROR_CODE_NO_ERROR] Success. [ARKUI_ERROR_CODE_PARAM_INVALID] Function parameter exception. [ARKUI_ERROR_CODE_NODE_NOT_ON_MAIN_TREE] The target node is not on main tree.

Available since API-level: 23