[drape] viewport on retina display fix.
This commit is contained in:
parent
908a3e0e35
commit
9ae536fa06
2 changed files with 6 additions and 6 deletions
|
@ -21,22 +21,22 @@ void Viewport::SetViewport(uint32_t x0, uint32_t y0, uint32_t w, uint32_t h)
|
|||
|
||||
uint32_t Viewport::GetX0() const
|
||||
{
|
||||
return m_zero.x;
|
||||
return m_zero.x * m_pixelRatio;
|
||||
}
|
||||
|
||||
uint32_t Viewport::GetY0() const
|
||||
{
|
||||
return m_zero.y;
|
||||
return m_zero.y * m_pixelRatio;
|
||||
}
|
||||
|
||||
uint32_t Viewport::GetWidth() const
|
||||
{
|
||||
return m_size.x;
|
||||
return m_size.x * m_pixelRatio;
|
||||
}
|
||||
|
||||
uint32_t Viewport::GetHeight() const
|
||||
{
|
||||
return m_size.y;
|
||||
return m_size.y * m_pixelRatio;
|
||||
}
|
||||
|
||||
void Viewport::Apply() const
|
||||
|
|
|
@ -111,6 +111,6 @@ void DrapeSurface::sizeChanged(int)
|
|||
|
||||
m2::PointF DrapeSurface::GetDevicePosition(QPoint const & p)
|
||||
{
|
||||
// qreal ratio = devicePixelRatio();
|
||||
return m2::PointF(p.x() /* ratio*/, p.y() /* ratio*/);
|
||||
qreal const ratio = devicePixelRatio();
|
||||
return m2::PointF(p.x() * ratio, p.y() * ratio);
|
||||
}
|
||||
|
|
Reference in a new issue