mirror of
https://github.com/openharmony/ace_ace_engine.git
synced 2026-07-21 01:45:30 -04:00
fix webview show when window drag
Signed-off-by: jiangdayuan <jiangdayuan@huawei.com>
This commit is contained in:
@@ -59,6 +59,9 @@ void RosenRenderWeb::Paint(RenderContext& context, const Offset& offset)
|
||||
LOGE("OnAttachContext context null");
|
||||
return;
|
||||
}
|
||||
if (pipelineContext->GetIsDragStart()) {
|
||||
drawSize_ = Size(1.0, 1.0);
|
||||
}
|
||||
if (drawSize_.Width() > pipelineContext->GetRootWidth() || drawSize_.Height() > pipelineContext->GetRootHeight()) {
|
||||
LOGE("Web drawSize height or width is invalid");
|
||||
}
|
||||
|
||||
@@ -1845,10 +1845,19 @@ void PipelineContext::WindowSizeChangeAnimate(int32_t width, int32_t height, Win
|
||||
[[fallthrough]];
|
||||
}
|
||||
case WindowSizeChangeReason::DRAG_START: {
|
||||
isDragStart_ = true;
|
||||
BlurWindowWithDrag(true);
|
||||
break;
|
||||
}
|
||||
case WindowSizeChangeReason::DRAG: {
|
||||
isFirstDrag_ = false;
|
||||
// Refresh once when first dragging.
|
||||
SetRootSizeWithWidthHeight(width, height);
|
||||
break;
|
||||
}
|
||||
case WindowSizeChangeReason::DRAG_END: {
|
||||
isDragStart_ = false;
|
||||
isFirstDrag_ = true;
|
||||
BlurWindowWithDrag(false);
|
||||
SetRootSizeWithWidthHeight(width, height);
|
||||
break;
|
||||
@@ -1875,7 +1884,7 @@ void PipelineContext::OnSurfaceChanged(int32_t width, int32_t height, WindowSize
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (type == WindowSizeChangeReason::DRAG) {
|
||||
if (type == WindowSizeChangeReason::DRAG && isDragStart_ && !isFirstDrag_) {
|
||||
LOGI("WindowSizeChangeReason is drag, no need change size.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1224,6 +1224,12 @@ public:
|
||||
{
|
||||
return isSubPipeline_;
|
||||
}
|
||||
|
||||
bool GetIsDragStart() const
|
||||
{
|
||||
return isDragStart_;
|
||||
}
|
||||
|
||||
private:
|
||||
void FlushVsync(uint64_t nanoTimestamp, uint32_t frameCount);
|
||||
void FlushPipelineWithoutAnimation();
|
||||
@@ -1391,6 +1397,8 @@ private:
|
||||
bool isJsPlugin_ = false;
|
||||
bool useLiteStyle_ = false;
|
||||
bool isFirstLoaded_ = true;
|
||||
bool isDragStart_ = false;
|
||||
bool isFirstDrag_ = true;
|
||||
uint64_t flushAnimationTimestamp_ = 0;
|
||||
TimeProvider timeProvider_;
|
||||
OnPageShowCallBack onPageShowCallBack_;
|
||||
|
||||
Reference in New Issue
Block a user