!15908 修复UIExtensionComponent组件的像素密度问题

Merge pull request !15908 from liyujie/densirt7
This commit is contained in:
openharmony_ci 2023-07-14 03:06:42 +00:00 committed by Gitee
commit 08c1841932
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 0 additions and 31 deletions

View File

@ -488,31 +488,6 @@ void UIExtensionPattern::SetOnReceiveCallback(std::function<void(const AAFwk::Wa
};
}
bool UIExtensionPattern::OnDirtyLayoutWrapperSwap(const RefPtr<LayoutWrapper>& dirty, const DirtySwapConfig& config)
{
CHECK_NULL_RETURN(dirty, false);
auto host = dirty->GetHostNode();
CHECK_NULL_RETURN(host, false);
auto globalOffsetWithTranslate = host->GetPaintRectGlobalOffsetWithTranslate();
auto geometryNode = dirty->GetGeometryNode();
CHECK_NULL_RETURN(geometryNode, false);
auto frameRect = geometryNode->GetFrameRect();
auto pipeline = PipelineBase::GetCurrentContext();
CHECK_NULL_RETURN(pipeline, false);
float density = static_cast<float>(pipeline->GetDensity());
Rosen::ViewPortConfig wmConfig {
.posX_ = std::round(globalOffsetWithTranslate.GetX()),
.posY_ = std::round(globalOffsetWithTranslate.GetY()),
.width_ = std::round(frameRect.Width()),
.height_ = std::round(frameRect.Height()),
.density_ = density
};
CHECK_NULL_RETURN(session_, false);
session_->UpdateViewConfig(wmConfig, Rosen::SizeChangeReason::UNDEFINED);
return false;
}
void UIExtensionPattern::OnVisibleChange(bool visible)
{
if (visible) {

View File

@ -49,7 +49,6 @@ public:
}
void SetOnRemoteReadyCallback(std::function<void(const RefPtr<UIExtensionProxy>&)>&& callback);
bool OnDirtyLayoutWrapperSwap(const RefPtr<LayoutWrapper>& dirty, const DirtySwapConfig& config) override;
void SetOnReleaseCallback(std::function<void(int32_t)>&& callback);
void SetOnResultCallback(std::function<void(int32_t, const AAFwk::Want&)>&& callback);
void SetOnReceiveCallback(std::function<void(const AAFwk::WantParams&)>&& callback);

View File

@ -48,10 +48,5 @@ FocusPattern UIExtensionPattern::GetFocusPattern() const
return { FocusType::NODE, true, FocusStyleType::NONE };
}
bool UIExtensionPattern::OnDirtyLayoutWrapperSwap(const RefPtr<LayoutWrapper>& dirty, const DirtySwapConfig& config)
{
return false;
}
void UIExtensionPattern::OnVisibleChange(bool visible) {}
} // namespace OHOS::Ace::NG