diff --git a/wmserver/src/window_layout_policy_cascade.cpp b/wmserver/src/window_layout_policy_cascade.cpp index ef9947522a..cce7e94c22 100644 --- a/wmserver/src/window_layout_policy_cascade.cpp +++ b/wmserver/src/window_layout_policy_cascade.cpp @@ -753,7 +753,7 @@ void WindowLayoutPolicyCascade::UpdateFloatingWindowSizeForStretchableWindow(con const auto& sizeLimits = node->GetWindowUpdatedSizeLimits(); float scale = std::min(static_cast(winRect.width_) / sizeLimits.minWidth_, static_cast(winRect.height_) / sizeLimits.minHeight_); - if (scale == 0) { + if (MathHelper::NearZero(scale)) { WLOGE("invalid sizeLimits"); return; }