diff --git a/frameworks/core/components_ng/pattern/shape/path_layout_algorithm.cpp b/frameworks/core/components_ng/pattern/shape/path_layout_algorithm.cpp index 66d4bad61b510a73998c9fb8d876e386ca602bf2..ae60bf01e8da11d6e40ab176754c2f2e436cf688 100644 --- a/frameworks/core/components_ng/pattern/shape/path_layout_algorithm.cpp +++ b/frameworks/core/components_ng/pattern/shape/path_layout_algorithm.cpp @@ -22,6 +22,7 @@ #include "base/utils/utils.h" #include "core/components_ng/base/frame_node.h" #include "core/components_ng/pattern/shape/path_paint_property.h" +#include "core/components_ng/render/drawing.h" namespace OHOS::Ace::NG { namespace { @@ -45,12 +46,20 @@ std::optional PathLayoutAlgorithm::MeasureContent( auto pathCommands = paintProperty->GetCommandsValue(""); CHECK_NULL_RETURN(!pathCommands.empty(), SizeF()); +#ifndef USE_ROSEN_DRAWING SkPath skPath; bool ret = SkParsePath::FromSVGString(pathCommands.c_str(), &skPath); CHECK_NULL_RETURN(ret, SizeF()); auto skRect = skPath.getBounds(); auto right = skRect.right(); auto bottom = skRect.bottom(); +#else + RSRecordingPath rsRecordingPath; + rsRecordingPath.BuildFromSVGSting(pathCommands); + auto rsRect = rsRecordingPath.GetBounds(); + auto right = rsRecordingPath.GetRight(); + auto bottom = rsRecordingPath.GetBottom(); +#endif if (NearZero(right) && NearZero(bottom)) { return SizeF(); }