fix dragController角标异常

Signed-off-by: b30058220 <baodi1@huawei.com>
Change-Id: I0e9cfa7697e505097ac6bafcfa51374d7c98a4a0
This commit is contained in:
b30058220 2024-09-24 08:21:53 +00:00
parent e2610d92f5
commit 38fe2e7ac4
3 changed files with 11 additions and 4 deletions

View File

@ -175,7 +175,7 @@ bool DragEventActuator::IsCurrentNodeStatusSuitableForDragging(
touchRestrict.inputEventType == InputEventType::AXIS || IsBelongToMultiItemNode(frameNode)) {
TAG_LOGI(AceLogTag::ACE_DRAG,
"No need to collect drag gestures result, drag forbidden set is %{public}d,"
"frameNode draggable is %{public}d, custom set is %{public}d,",
"frameNode draggable is %{public}d, custom set is %{public}d",
gestureHub->IsDragForbidden(), frameNode->IsDraggable(), frameNode->IsCustomerSet());
return false;
}

View File

@ -683,7 +683,7 @@ public:
}
void SetBindMenuStatus(bool setIsShow, bool isShow, MenuPreviewMode previewMode);
const BindMenuStatus& GetBindMenuStatus()
const BindMenuStatus& GetBindMenuStatus() const
{
return bindMenuStatus_;
}

View File

@ -1403,8 +1403,15 @@ bool ParsePreviewOptions(
napi_get_named_property(asyncCtx->env, previewOptionsNApi, "numberBadge", &numberBadgeNApi);
napi_typeof(asyncCtx->env, numberBadgeNApi, &valueType);
if (valueType == napi_number) {
asyncCtx->dragPreviewOption.isNumber = true;
napi_get_value_int32(asyncCtx->env, numberBadgeNApi, &asyncCtx->dragPreviewOption.badgeNumber);
int64_t number = 0;
napi_get_value_int64(asyncCtx->env, numberBadgeNApi, &number);
if (number < 0 || number > INT_MAX) {
asyncCtx->dragPreviewOption.isNumber = false;
asyncCtx->dragPreviewOption.isShowBadge = true;
} else {
asyncCtx->dragPreviewOption.isNumber = true;
napi_get_value_int32(asyncCtx->env, numberBadgeNApi, &asyncCtx->dragPreviewOption.badgeNumber);
}
} else if (valueType == napi_boolean) {
asyncCtx->dragPreviewOption.isNumber = false;
napi_get_value_bool(asyncCtx->env, numberBadgeNApi, &asyncCtx->dragPreviewOption.isShowBadge);