1 /* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #include "core/components_ng/pattern/shape/shape_paint_property.h" 17 18 #include <string> 19 20 #include "base/log/log_wrapper.h" 21 #include "base/utils/utils.h" 22 23 namespace OHOS::Ace::NG { 24 UpdateShapeProperty(const RefPtr<ShapePaintProperty> & target)25void ShapePaintProperty::UpdateShapeProperty(const RefPtr<ShapePaintProperty>& target) 26 { 27 CHECK_NULL_VOID(target); 28 if (!HasAntiAlias() && target->HasAntiAlias()) { 29 UpdateAntiAlias(target->GetAntiAliasValue()); 30 } 31 if (!HasFill() && target->HasFill()) { 32 UpdateFill(target->GetFillValue()); 33 } 34 if (!HasFillOpacity() && target->HasFillOpacity()) { 35 UpdateFillOpacity(target->GetFillOpacityValue()); 36 } 37 if (!HasStroke() && target->HasStroke()) { 38 UpdateStroke(target->GetStrokeValue()); 39 } 40 if (!HasStrokeDashArray() && target->HasStrokeDashArray()) { 41 UpdateStrokeDashArray(target->GetStrokeDashArrayValue()); 42 } 43 if (!HasStrokeDashOffset() && target->HasStrokeDashOffset()) { 44 UpdateStrokeDashOffset(target->GetStrokeDashOffsetValue()); 45 } 46 if (!HasStrokeLineCap() && target->HasStrokeLineCap()) { 47 UpdateStrokeLineCap(target->GetStrokeLineCapValue()); 48 } 49 if (!HasStrokeLineJoin() && target->HasStrokeLineJoin()) { 50 UpdateStrokeLineJoin(target->GetStrokeLineJoinValue()); 51 } 52 if (!HasStrokeMiterLimit() && target->HasStrokeMiterLimit()) { 53 UpdateStrokeMiterLimit(target->GetStrokeMiterLimitValue()); 54 } 55 if (!HasStrokeOpacity() && target->HasStrokeOpacity()) { 56 UpdateStrokeOpacity(target->GetStrokeOpacityValue()); 57 } 58 if (!HasStrokeWidth() && target->HasStrokeWidth()) { 59 UpdateStrokeWidth(target->GetStrokeWidthValue()); 60 } 61 } 62 63 } // namespace OHOS::Ace::NG 64