forked from organicmaps/organicmaps
[yopme] fix scales for rendering
This commit is contained in:
parent
dd3c6a2e16
commit
96f4629a38
2 changed files with 15 additions and 8 deletions
|
@ -86,7 +86,17 @@ void YopmeRP::DrawFrame(shared_ptr<PaintEvent> const & e, ScreenBase const & s)
|
|||
pScreen->clear(m_bgColor);
|
||||
|
||||
shared_ptr<PaintEvent> paintEvent(new PaintEvent(m_offscreenDrawer.get()));
|
||||
m_renderFn(paintEvent, s, m2::RectD(renderRect), scales::GetScaleLevel(s.GlobalRect().GetGlobalRect()));
|
||||
|
||||
size_t const scaleEtalonSize = 256;
|
||||
|
||||
m2::RectD glbRect;
|
||||
m2::PointD const pxCenter = s.PixelRect().Center();
|
||||
|
||||
s.PtoG(m2::RectD(pxCenter - m2::PointD(scaleEtalonSize / 2, scaleEtalonSize / 2),
|
||||
pxCenter + m2::PointD(scaleEtalonSize / 2, scaleEtalonSize / 2)),
|
||||
glbRect);
|
||||
|
||||
m_renderFn(paintEvent, s, m2::RectD(renderRect), scales::GetScaleLevel(glbRect));
|
||||
|
||||
pScreen->endFrame();
|
||||
pScreen->resetOverlay();
|
||||
|
|
|
@ -36,7 +36,7 @@ void GLWidget::initializeGL()
|
|||
rpParams.m_density = graphics::EDensityMDPI;
|
||||
rpParams.m_skinName = "basic.skn";
|
||||
rpParams.m_screenHeight = 640;
|
||||
rpParams.m_screenWidth = 340;
|
||||
rpParams.m_screenWidth = 360;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -47,6 +47,8 @@ void GLWidget::initializeGL()
|
|||
{
|
||||
LOG(LERROR, (e.what()));
|
||||
}
|
||||
|
||||
resize(360, 640);
|
||||
}
|
||||
|
||||
void GLWidget::resizeGL(int w, int h)
|
||||
|
@ -58,12 +60,7 @@ void GLWidget::resizeGL(int w, int h)
|
|||
|
||||
void GLWidget::paintGL()
|
||||
{
|
||||
m_f.GetNavigator().SetFromRect(m2::AnyRectD(
|
||||
m2::RectD(MercatorBounds::LonToX(26.90),
|
||||
MercatorBounds::LatToY(53.42),
|
||||
MercatorBounds::LonToX(27.80),
|
||||
MercatorBounds::LatToY(54.64))));
|
||||
|
||||
m_f.ShowRect(53.54, 27.34, 11.0);
|
||||
|
||||
shared_ptr<PaintEvent> e(new PaintEvent(m_f.GetRenderPolicy()->GetDrawer().get()));
|
||||
m_f.BeginPaint(e);
|
||||
|
|
Loading…
Add table
Reference in a new issue