From f09bcdbc7e2b44a8e4363136f9e11004404584b8 Mon Sep 17 00:00:00 2001 From: ExMix Date: Sat, 7 Feb 2015 20:56:20 +0300 Subject: [PATCH] [drape] correct viewport for desktop app --- drape_head/drape_surface.cpp | 4 ++-- qt/draw_widget.cpp | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drape_head/drape_surface.cpp b/drape_head/drape_surface.cpp index ec8e2f5cd0..8888c8672b 100644 --- a/drape_head/drape_surface.cpp +++ b/drape_head/drape_surface.cpp @@ -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(); } } diff --git a/qt/draw_widget.cpp b/qt/draw_widget.cpp index 9816da4eb4..859830d87d 100644 --- a/qt/draw_widget.cpp +++ b/qt/draw_widget.cpp @@ -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(devicePixelRatio()); - m_framework->OnSize(scaleFactor * width(), scaleFactor * height()); + m_framework->OnSize(m_ratio * width(), m_ratio * height()); UpdateScaleControl(); }