Changes to be committed:
	modified:   uitest/core/widget_operator.cpp
	modified:   uitest/napi/uitest_napi.cpp
This commit is contained in:
肖帅
2022-07-12 11:57:13 +08:00
parent 3dbe9dd87e
commit 947a54a951
2 changed files with 5 additions and 2 deletions
+2 -2
View File
@@ -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");
+3
View File
@@ -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, &paramArray));
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));