From ccc77fb372f4555df2b0082da0c46719d934fafc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B0=B8=E5=87=AF?= Date: Thu, 24 Jul 2025 17:39:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:indexer=E5=AE=89=E5=85=A8=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 刘永凯 --- .../pattern/indexer/arc_indexer_layout_algorithm.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frameworks/core/components_ng/pattern/indexer/arc_indexer_layout_algorithm.cpp b/frameworks/core/components_ng/pattern/indexer/arc_indexer_layout_algorithm.cpp index 8cd0da5f220..d7c219d592d 100644 --- a/frameworks/core/components_ng/pattern/indexer/arc_indexer_layout_algorithm.cpp +++ b/frameworks/core/components_ng/pattern/indexer/arc_indexer_layout_algorithm.cpp @@ -118,6 +118,7 @@ void ArcIndexerLayoutAlgorithm::Layout(LayoutWrapper* layoutWrapper) OffsetT ArcIndexerLayoutAlgorithm::CalcArcItemPosition(LayoutWrapper* layoutWrapper, int32_t index) { + CHECK_NULL_RETURN(layoutWrapper->GetLayoutProperty(), OffsetT(Dimension(0.0f), Dimension(0.0f))); auto padding = layoutWrapper->GetLayoutProperty()->CreatePaddingWithoutBorder(); float itemAngle = (startAngle_ + stepAngle_ * index) * ACE_PI / HALF_CIRCLE_ANGLE; auto positionX = arcCenter_.GetX() + arcRadius_ * cos(itemAngle) - itemRadius_ - padding.left.value_or(0); @@ -152,6 +153,7 @@ void ArcIndexerLayoutAlgorithm::MeasureArc(LayoutWrapper* layoutWrapper) auto width = layoutWrapper->GetGeometryNode()->GetFrameSize().Width(); auto height = layoutWrapper->GetGeometryNode()->GetFrameSize().Height(); + CHECK_NULL_VOID(layoutWrapper->GetLayoutProperty()); const auto& paddingAndBorder = layoutWrapper->GetLayoutProperty()->CreatePaddingAndBorderWithDefault(0, 0, 0, 0); auto verticalPadding = paddingAndBorder.top.value_or(0) + paddingAndBorder.bottom.value_or(0); auto horizontalPadding = paddingAndBorder.left.value_or(0.0f) + paddingAndBorder.right.value_or(0.0f); -- Gitee