mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 15:10:30 +00:00
commit
102fdb1320
@ -384,7 +384,7 @@ public:
|
|||||||
double GetWindowDensity() const
|
double GetWindowDensity() const
|
||||||
{
|
{
|
||||||
if (!uiWindow_) {
|
if (!uiWindow_) {
|
||||||
return 0.0;
|
return 1.0;
|
||||||
}
|
}
|
||||||
return static_cast<double>(uiWindow_->GetVirtualPixelRatio());
|
return static_cast<double>(uiWindow_->GetVirtualPixelRatio());
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,7 @@ double PipelineBase::GetCurrentDensity()
|
|||||||
}
|
}
|
||||||
CHECK_NULL_RETURN(pipelineContext, SystemProperties::GetDefaultResolution());
|
CHECK_NULL_RETURN(pipelineContext, SystemProperties::GetDefaultResolution());
|
||||||
double wmDensity = pipelineContext->GetWindowDensity();
|
double wmDensity = pipelineContext->GetWindowDensity();
|
||||||
if (GreatNotEqual(wmDensity, 0.0)) {
|
if (GreatNotEqual(wmDensity, 1.0)) {
|
||||||
return wmDensity;
|
return wmDensity;
|
||||||
}
|
}
|
||||||
return pipelineContext->GetDensity();
|
return pipelineContext->GetDensity();
|
||||||
|
@ -282,7 +282,7 @@ public:
|
|||||||
if (windowDensityCallback_) {
|
if (windowDensityCallback_) {
|
||||||
return windowDensityCallback_();
|
return windowDensityCallback_();
|
||||||
}
|
}
|
||||||
return 0.0;
|
return 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t RegisterDensityChangedCallback(std::function<void(double)>&& callback)
|
int32_t RegisterDensityChangedCallback(std::function<void(double)>&& callback)
|
||||||
|
Loading…
Reference in New Issue
Block a user