mirror of
https://github.com/openharmony/arkXtest.git
synced 2026-07-21 08:15:23 -04:00
Signed-off-by: 肖帅 <xiaoshuai6@hisilicon.com>
Changes to be committed: modified: uitest/core/widget_operator.cpp modified: uitest/napi/uitest_napi.cpp
This commit is contained in:
@@ -141,8 +141,8 @@ namespace OHOS::uitest {
|
||||
}
|
||||
auto rootBound = recv.front()->GetBounds();
|
||||
auto rectBound = widget_.GetBounds();
|
||||
float_t widthScale = (float_t)(rootBound.GetWidth() / rectBound.GetWidth());
|
||||
float_t heightScale = (float_t)(rootBound.GetHeight() / rectBound.GetHeight());
|
||||
float_t widthScale = (float_t)(rootBound.GetWidth()) / (float_t)(rectBound.GetWidth());
|
||||
float_t heightScale = (float_t)(rootBound.GetHeight()) / (float_t)(rectBound.GetHeight());
|
||||
float_t originalScale = min(widthScale, heightScale);
|
||||
if (scale < 0) {
|
||||
error = ApiCallErr(USAGE_ERROR, "Please input the correct scale");
|
||||
|
||||
@@ -334,6 +334,9 @@ namespace OHOS::uitest {
|
||||
// 1. marshal parameters into json-array
|
||||
napi_value paramArray = nullptr;
|
||||
NAPI_CALL(env, napi_create_array_with_length(env, count, ¶mArray));
|
||||
if (count > NAPI_MAX_ARG_COUNT) {
|
||||
count = NAPI_MAX_ARG_COUNT;
|
||||
}
|
||||
for (size_t idx = 0; idx < count; idx++) {
|
||||
napi_value item = nullptr; // convert to backendObjRef if any
|
||||
NAPI_CALL(env, GetBackendObjRefProp(env, argv[idx], &item));
|
||||
|
||||
Reference in New Issue
Block a user