mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-10-07 16:33:54 +00:00
!15908 修复UIExtensionComponent组件的像素密度问题
Merge pull request !15908 from liyujie/densirt7
This commit is contained in:
commit
08c1841932
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user