[drape] correct viewport for desktop app

This commit is contained in:
ExMix 2015-02-07 20:56:20 +03:00 committed by r.kuznetsov
parent f4a87c2d85
commit f09bcdbc7e
2 changed files with 4 additions and 5 deletions

View file

@ -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();
}
}

View file

@ -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();
}