Skip to main content

OH_ArkUI_NativeModule_ConvertPositionFromWindow

Function OH_ArkUI_NativeModule_ConvertPositionFromWindow 

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

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

§Arguments

{ArkUI_NodeHandle } targetNode ArkUI_NodeHandle The target node.

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

{ArkUI_IntOffset*} localPosition The converted coordinates in the target node’s local 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