From bdb96a878746e2bb7511e06e82544932c5a09517 Mon Sep 17 00:00:00 2001 From: geraltxu Date: Fri, 27 Dec 2024 09:10:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=AA=97=E5=8F=A3=E6=8B=96?= =?UTF-8?q?=E6=8B=BD=E4=BC=98=E5=8C=96=E7=B3=BB=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xufanghan --- ohos_nweb/src/nweb_impl.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ohos_nweb/src/nweb_impl.cc b/ohos_nweb/src/nweb_impl.cc index 260cf9f8f2..0fcd45b8af 100644 --- a/ohos_nweb/src/nweb_impl.cc +++ b/ohos_nweb/src/nweb_impl.cc @@ -962,6 +962,7 @@ void NWebImpl::DragResize(uint32_t width, uint32_t height, uint32_t pre_height, LOG(DEBUG) << "===== start drag resize ====="; bool drag_bigger_height = false; bool drag_bigger_width = false; + int32_t adjustRatio = 15; if (input_handler_ == nullptr || output_handler_ == nullptr) { return; } @@ -972,17 +973,19 @@ void NWebImpl::DragResize(uint32_t width, uint32_t height, uint32_t pre_height, if (pre_width > 0) { drag_bigger_width = true; } + LOG(DEBUG) << "===== drag resize orign width =====" << width << "===== drag resize orign height =====" << height; if (drag_bigger_height) { height = OHOS::NWeb::NWebResizeHelper::GetInstance().GetResizeAdjustValue(height, - pre_height, + pre_height * adjustRatio, true); } if (drag_bigger_width) { width = OHOS::NWeb::NWebResizeHelper::GetInstance().GetResizeAdjustValue(width, - pre_width, + pre_width * adjustRatio, false); } OHOS::NWeb::NWebResizeHelper::GetInstance().SetResizeHeightAndWidth(height, width); + LOG(DEBUG) << "===== drag resize real width =====" << width << "===== drag resize real height =====" << height; if (width > kSurfaceMaxWidth || height > kSurfaceMaxHeight) { if (draw_mode_ == 0) { OHOS::NWeb::NWebResizeHelper::GetInstance().RefreshParam(); -- Gitee