修复输入maxlines为MIN_SAFE_INTEGER时仍然显示1行的bug

Signed-off-by: FTL1ght <zhangyubao@h-partners.com>
This commit is contained in:
FTL1ght 2024-09-18 21:12:19 +08:00
parent cff5401eed
commit edb4469976

View File

@ -381,8 +381,8 @@ bool GetParagraphStyleFromJS(napi_env env, napi_value argValue, TypographyStyle&
}
napi_get_named_property(env, argValue, "maxLines", &tempValue);
int32_t maxLines = 0;
if (tempValue != nullptr && napi_get_value_int32(env, tempValue, &maxLines) == napi_ok) {
int64_t maxLines = 0;
if (tempValue != nullptr && napi_get_value_int64(env, tempValue, &maxLines) == napi_ok) {
pographyStyle.maxLines = maxLines < 0 ? 0 : maxLines;
}