From 68996fb57d01f8f4c002510b79c144ace86ef09d Mon Sep 17 00:00:00 2001 From: Beluga <1395828939@qq.com> Date: Tue, 25 Jun 2024 22:13:44 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=BD=93=E5=AE=BD=E5=BA=A6=E4=B8=BA0?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E4=B9=9F=E5=90=8C=E6=A0=B7=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=B8=BAsheetwidth?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Beluga <1395828939@qq.com> --- .../pattern/overlay/sheet_presentation_layout_algorithm.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frameworks/core/components_ng/pattern/overlay/sheet_presentation_layout_algorithm.cpp b/frameworks/core/components_ng/pattern/overlay/sheet_presentation_layout_algorithm.cpp index 0b7189cfc98..2539fdf5685 100755 --- a/frameworks/core/components_ng/pattern/overlay/sheet_presentation_layout_algorithm.cpp +++ b/frameworks/core/components_ng/pattern/overlay/sheet_presentation_layout_algorithm.cpp @@ -96,7 +96,8 @@ void SheetPresentationLayoutAlgorithm::Measure(LayoutWrapper* layoutWrapper) } else { width = sheetStyle_.width->ConvertToPx(); } - if (width > maxSize.Width() || width < 0.0f) { + // set width to sheetWidth if width is over limit + if (width > maxSize.Width() || width <= 0.0f) { width = sheetWidth_; } sheetWidth_ = width; -- Gitee