!34420 [NDK] fix linearGradient and blur

Merge pull request !34420 from lisitao/li_7
This commit is contained in:
openharmony_ci 2024-06-03 08:48:19 +00:00 committed by Gitee
commit f00990dda2
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 5 additions and 1 deletions

View File

@ -3940,6 +3940,7 @@ Dimension ViewAbstract::GetFrontBlur(FrameNode* frameNode)
auto target = frameNode->GetRenderContext();
CHECK_NULL_RETURN(target, value);
auto& property = target->GetForeground();
CHECK_NULL_RETURN(property, value);
auto getValue = property->propBlurRadius;
if (getValue.has_value()) {
return getValue.value();

View File

@ -43,6 +43,7 @@ struct ArkUI_Node {
void* swiperIndicator = nullptr;
void* imageFrameInfos = nullptr;
void* drawableDescriptor = nullptr;
int32_t linearGradientDirection = -1;
};
struct ArkUI_Context {

View File

@ -1302,6 +1302,8 @@ int32_t SetLinearGradient(ArkUI_NodeHandle node, const ArkUI_AttributeItem* item
if (item->object == nullptr) {
return ERROR_CODE_PARAM_INVALID;
}
//save direction value in node;
node->linearGradientDirection = item->value[NUM_1].i32;
auto* fullImpl = GetFullImpl();
const ArkUI_ColorStop* colorStop = reinterpret_cast<ArkUI_ColorStop*>(item->object);
int size = colorStop->size;
@ -1338,7 +1340,7 @@ const ArkUI_AttributeItem* GetLinearGradient(ArkUI_NodeHandle node)
//angle
g_numberValues[0].f32 = values[0];
//direction
g_numberValues[1].i32 = values[1];
g_numberValues[1].i32 = node->linearGradientDirection > -1 ? node->linearGradientDirection : values[1];
//repeated
g_numberValues[2].i32 = values[2];
//size