forked from organicmaps/organicmaps
[drape] correct viewport for desktop app
This commit is contained in:
parent
f4a87c2d85
commit
f09bcdbc7e
2 changed files with 4 additions and 5 deletions
|
@ -132,7 +132,7 @@ void DrapeSurface::CreateEngine()
|
|||
m_model.ReadFeatures(fn, ids);
|
||||
};
|
||||
|
||||
m_drapeEngine = TEnginePrt(new df::DrapeEngine(f, df::Viewport(0, 0, width(), height()),
|
||||
m_drapeEngine = TEnginePrt(new df::DrapeEngine(f, df::Viewport(0, 0, pixelRatio * width(), pixelRatio * height()),
|
||||
df::MapDataProvider(idReadFn, featureReadFn), pixelRatio));
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ void DrapeSurface::sizeChanged(int)
|
|||
int w = width() * vs;
|
||||
int h = height() * vs;
|
||||
m_navigator.OnSize(0, 0, w, h);
|
||||
m_drapeEngine->Resize(width(), height());
|
||||
m_drapeEngine->Resize(w, h);
|
||||
UpdateCoverage();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -194,7 +194,7 @@ namespace qt
|
|||
|
||||
void DrawWidget::CreateEngine()
|
||||
{
|
||||
m_framework->CreateDrapeEngine(m_contextFactory.GetRefPointer(), m_ratio, width(), height());
|
||||
m_framework->CreateDrapeEngine(m_contextFactory.GetRefPointer(), m_ratio, m_ratio * width(), m_ratio * height());
|
||||
}
|
||||
|
||||
void DrawWidget::exposeEvent(QExposeEvent * e)
|
||||
|
@ -419,8 +419,7 @@ namespace qt
|
|||
|
||||
void DrawWidget::sizeChanged(int)
|
||||
{
|
||||
double scaleFactor = static_cast<double>(devicePixelRatio());
|
||||
m_framework->OnSize(scaleFactor * width(), scaleFactor * height());
|
||||
m_framework->OnSize(m_ratio * width(), m_ratio * height());
|
||||
|
||||
UpdateScaleControl();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue