diff options
author | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2015-05-22 15:29:03 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:48:15 +0300 |
commit | ccdcd85f9f0ced581a8be6ba4d18758159cbc3c1 (patch) | |
tree | 853d0239dd7ac5a43d3135c4deb37bd601f2b69b /map/information_display.cpp | |
parent | 29311d27a8a4c46a70e0997499f02683b955dca4 (diff) |
A universal interface for changing pivot points on widgets on the map was implemented. Now with the help of the interface it's possible to change pivot points of any widget on the map.
Diffstat (limited to 'map/information_display.cpp')
-rw-r--r-- | map/information_display.cpp | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/map/information_display.cpp b/map/information_display.cpp index 845c76086c..714400cb89 100644 --- a/map/information_display.cpp +++ b/map/information_display.cpp @@ -157,12 +157,14 @@ void InformationDisplay::setController(gui::Controller * controller) m_framework->GetAnimController()->AddTask(task); } -void InformationDisplay::setDisplayRect(m2::RectI const & rect) +void InformationDisplay::SetWidgetPivotsByDefault(int screenWidth, int screenHeight) { double rulerOffsX = RULLER_X_OFFSET; double rulerOffsY = RULLER_Y_OFFSET; double compassOffsX = COMPASS_X_OFFSET; double compassOffsY = COMPASS_Y_OFFSET; + m2::RectI const rect = m2::RectI(0, 0, screenWidth, screenHeight); + #ifdef OMIM_OS_ANDROID if (GetPlatform().IsTablet()) { @@ -282,3 +284,33 @@ void InformationDisplay::ResetRouteMatchingInfo() { m_locationState->ResetRouteMatchingInfo(); } + +void InformationDisplay::SetWidgetPivot(WidgetType widget, m2::PointD const & pivot) +{ + ASSERT(m_ruler, ()); + switch(widget) + { + case WidgetType::Ruler: + if (m_ruler) + m_ruler->setPivot(pivot); + return; + case WidgetType::CopyrightLabel: + if (m_copyrightLabel) + m_copyrightLabel->setPivot(pivot); + return; + case WidgetType::CountryStatusDisplay: + if (m_countryStatusDisplay) + m_countryStatusDisplay->setPivot(pivot); + return; + case WidgetType::CompassArrow: + if (m_compassArrow) + m_compassArrow->setPivot(pivot); + return; + case WidgetType::DebugLable: + if (m_debugLabel) + m_debugLabel->setPivot(pivot); + return; + default: + ASSERT(false, ()); + } +} |