fix pixelmap动态切换

Signed-off-by: zhangjinyu101 <zhangjinyu101@huawei.com>
Change-Id: I42e4aa9c1e6856eb7de6c24c738a834a9d317867
This commit is contained in:
zhangjinyu101 2024-07-31 14:55:52 +08:00
parent 536dc53d0c
commit d74dc37b74

View File

@ -472,14 +472,19 @@ int32_t OH_ArkUI_SetNodeDragPreviewOption(ArkUI_NodeHandle node, ArkUI_DragPrevi
int32_t OH_ArkUI_SetNodeDragPreview(ArkUI_NodeHandle node, OH_PixelmapNative* preview)
{
auto* impl = OHOS::Ace::NodeModel::GetFullImpl();
if (!impl || !node || !preview) {
if (!impl || !node) {
return ARKUI_ERROR_CODE_PARAM_INVALID;
}
if (!preview) {
impl->getNodeModifiers()->getCommonModifier()->resetDragPreview(node->uiNodeHandle);
return ARKUI_ERROR_CODE_NO_ERROR;
}
auto previewPixelNative = reinterpret_cast<OH_PixelmapNativeHandle>(preview);
auto pixelMap = previewPixelNative->GetInnerPixelmap();
impl->getDragAdapterAPI()->setDragPreview(node->uiNodeHandle, &pixelMap);
return ARKUI_ERROR_CODE_NO_ERROR;
}
int32_t OH_ArkUI_SetNodeAllowedDropDataTypes(ArkUI_NodeHandle node, const char* typesArray[], int32_t count)
{
auto* fullImpl = OHOS::Ace::NodeModel::GetFullImpl();