forked from organicmaps/organicmaps
Fixed PixelRectIn3d usage
This commit is contained in:
parent
0deff0b51a
commit
98b7a126cf
4 changed files with 6 additions and 11 deletions
|
@ -10,10 +10,8 @@ namespace
|
|||
{
|
||||
m2::PointF PixelPointToScreenSpace(ScreenBase const & screen, m2::PointF const & pt)
|
||||
{
|
||||
float const szX = static_cast<float>(screen.isPerspective() ? screen.PixelRectIn3d().SizeX() :
|
||||
screen.PixelRect().SizeX());
|
||||
float const szY = static_cast<float>(screen.isPerspective() ? screen.PixelRectIn3d().SizeY() :
|
||||
screen.PixelRect().SizeY());
|
||||
float const szX = static_cast<float>(screen.PixelRectIn3d().SizeX());
|
||||
float const szY = static_cast<float>(screen.PixelRectIn3d().SizeY());
|
||||
return m2::PointF(pt.x / szX - 0.5f, -pt.y / szY + 0.5f) * 2.0f;
|
||||
}
|
||||
} // namespace
|
||||
|
|
|
@ -454,12 +454,10 @@ void detail::OverlayTraits::SetModelView(ScreenBase const & modelView)
|
|||
|
||||
double const extension = m_visualScale * kScreenPixelRectExtension;
|
||||
double const doubleExtension = 2.0 * extension;
|
||||
m2::RectD screenRect = modelView.isPerspective() ? modelView.PixelRectIn3d()
|
||||
: modelView.PixelRect();
|
||||
m_extendedScreenRect = screenRect;
|
||||
m_extendedScreenRect = modelView.PixelRectIn3d();
|
||||
m_extendedScreenRect.Inflate(extension, extension);
|
||||
|
||||
m_displacersFreeRect = screenRect;
|
||||
m_displacersFreeRect = modelView.PixelRectIn3d();
|
||||
if (m_displacersFreeRect.SizeX() > doubleExtension && m_displacersFreeRect.SizeY() > doubleExtension)
|
||||
m_displacersFreeRect.Inflate(-extension, -extension);
|
||||
else
|
||||
|
|
|
@ -184,7 +184,7 @@ void MyPositionController::UpdatePosition()
|
|||
|
||||
void MyPositionController::OnUpdateScreen(ScreenBase const & screen)
|
||||
{
|
||||
m_pixelRect = screen.isPerspective() ? screen.PixelRectIn3d() : screen.PixelRect();
|
||||
m_pixelRect = screen.PixelRectIn3d();
|
||||
m_positionYOffset = screen.isPerspective() ? kPositionOffsetYIn3D : kPositionOffsetY;
|
||||
if (m_visiblePixelRect.IsEmptyInterior())
|
||||
m_visiblePixelRect = m_pixelRect;
|
||||
|
|
|
@ -1178,8 +1178,7 @@ void Framework::ShowAll()
|
|||
|
||||
m2::PointD Framework::GetPixelCenter() const
|
||||
{
|
||||
return m_currentModelView.isPerspective() ? m_currentModelView.PixelRectIn3d().Center()
|
||||
: m_currentModelView.PixelRect().Center();
|
||||
return m_currentModelView.PixelRectIn3d().Center();
|
||||
}
|
||||
|
||||
m2::PointD Framework::GetVisiblePixelCenter() const
|
||||
|
|
Loading…
Add table
Reference in a new issue