From ce167ae8a6c4f5a5c7209a4e596c86a2f2671b74 Mon Sep 17 00:00:00 2001 From: hehongyang9 Date: Thu, 6 Mar 2025 11:05:57 +0800 Subject: [PATCH] translate support percent Signed-off-by: hehongyang9 Change-Id: I242aeb10faa68b03e72c05740cdb5673fccc2b92 --- arkui/ace_engine/native/native_node.h | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index c246d755f..8a6c30ea2 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -1924,6 +1924,40 @@ typedef enum { */ NODE_VISIBLE_AREA_APPROXIMATE_CHANGE_RATIO = 102, + /** + * @brief Defines the translate attribute, which supports for percentile translation input, and can be set, reset, + * and obtained as required through APIs.\n + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].f32: distance to translate along the x-axis. The default unit is percentage. + * The unit is vp unless value[3] exists and value[3] is 0. The default value of value[0] is 0.\n + * .value[1].f32: distance to translate along the y-axis. The default unit is percentage. + * The unit is vp unless value[4] exists and value[4] is 0. The default value of value[1] is 0.\n + * .value[2].f32: distance to translate along the z-axis, in vp. The default value is 0.\n + * .value[3]?.i32: Whether the translation distance along the x-axis is specified as a percentage. The value can be 0 or 1. + * When the value is 1, it is specified as a percentage. + * For example, value[0].f32=0.1 and value[3].i32=1 indicates a 10% shift in the x direction. + * The default value is 1.\n + * .value[4]?.i32: Whether the translation distance along the y-axis is specified as a percentage. The value can be 0 or 1. + * When the value is 1, it is specified as a percentage. + * For example, value[1].f32=0.1 and value[4].i32=1 indicates a 10% shift in the y direction. + * The default value is 1.\n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].f32: distance to translate along the x-axis. The unit depends on value[3].\n + * .value[1].f32: distance to translate along the y-axis. The unit depends on value[4].\n + * .value[2].f32: distance to translate along the z-axis. The unit is vp.\n + * .value[3].i32: Whether the unit of the X-axis translation distance is in percentage. When value[3].i32 is 0, + * the unit of the X-axis translation distance is vp; when value[3].i32 is 1, the unit of the X-axis translation + * distance is percentage;\n + * .value[4].i32: Whether the unit of the Y-axis translation distance is in percentage. When value[4].i32 is 0, + * the unit of the Y-axis translation distance is vp; when value[4].i32 is 1, the unit of the Y-axis translation + * distance is percentage;\n + * + * @since 20 + */ + NODE_TRANSLATE_WITH_PERCENT = 103, + /** * @brief Defines the text content attribute, which can be set, reset, and obtained as required through APIs. * -- Gitee