diff options
author | vng <viktor.govako@gmail.com> | 2015-05-18 13:22:36 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:48:13 +0300 |
commit | b54187d51f880826c7814ae1f340d1c6551e21d9 (patch) | |
tree | 7e99e0b87d5ee56147b7f189547acd96e647efdc /qt/draw_widget.cpp | |
parent | 06751fb0308f44f5eb96e94327f46b8753b7c238 (diff) |
Review fixes.
Diffstat (limited to 'qt/draw_widget.cpp')
-rw-r--r-- | qt/draw_widget.cpp | 77 |
1 files changed, 22 insertions, 55 deletions
diff --git a/qt/draw_widget.cpp b/qt/draw_widget.cpp index 6f43945ca3..4e6969ed1c 100644 --- a/qt/draw_widget.cpp +++ b/qt/draw_widget.cpp @@ -465,66 +465,33 @@ namespace qt } else if (e->button() == Qt::RightButton) { - if (e->modifiers() & Qt::ShiftModifier) - { - if (!m_framework->IsSingleFrameRendererInited()) - m_framework->InitSingleFrameRenderer(graphics::EDensityXHDPI); - // Watch emulation on desktop - m2::PointD pt = GetDevicePoint(e); - Framework::SingleFrameSymbols symbols; - symbols.m_searchResult = m_framework->PtoG(pt) + m2::PointD(0.05, 0.03); - symbols.m_showSearchResult = true; - symbols.m_bottomZoom = 11; - - { - FrameImage img; - m_framework->DrawSingleFrame(m_framework->PtoG(pt), 0, 320, 320, img, symbols); - FileWriter writer(GetPlatform().WritablePathForFile("cpu-rendered-image.png")); - writer.Write(img.m_data.data(), img.m_data.size()); - } - { - FrameImage img; - m_framework->DrawSingleFrame(m_framework->PtoG(pt), -2, 320, 320, img, symbols); - FileWriter writer(GetPlatform().WritablePathForFile("cpu-rendered-image-1.png")); - writer.Write(img.m_data.data(), img.m_data.size()); - } - { - FrameImage img; - m_framework->DrawSingleFrame(m_framework->PtoG(pt), 2, 320, 320, img, symbols); - FileWriter writer(GetPlatform().WritablePathForFile("cpu-rendered-image+1.png")); - writer.Write(img.m_data.data(), img.m_data.size()); - } - } + // show feature types + QMenu menu; + + // Get POI under cursor or nearest address by point. + m2::PointD dummy; + search::AddressInfo info; + feature::FeatureMetadata metadata; + if (m_framework->GetVisiblePOI(pt, dummy, info, metadata)) + add_string(menu, "POI"); else - { - // show feature types - QMenu menu; - - // Get POI under cursor or nearest address by point. - m2::PointD dummy; - search::AddressInfo info; - feature::FeatureMetadata metadata; - if (m_framework->GetVisiblePOI(pt, dummy, info, metadata)) - add_string(menu, "POI"); - else - m_framework->GetAddressInfoForPixelPoint(pt, info); + m_framework->GetAddressInfoForPixelPoint(pt, info); - // Get feature types under cursor. - vector<string> types; - m_framework->GetFeatureTypes(pt, types); - for (size_t i = 0; i < types.size(); ++i) - add_string(menu, types[i]); + // Get feature types under cursor. + vector<string> types; + m_framework->GetFeatureTypes(pt, types); + for (size_t i = 0; i < types.size(); ++i) + add_string(menu, types[i]); - (void)menu.addSeparator(); + (void)menu.addSeparator(); - // Format address and types. - if (!info.m_name.empty()) - add_string(menu, info.m_name); - add_string(menu, info.FormatAddress()); - add_string(menu, info.FormatTypes()); + // Format address and types. + if (!info.m_name.empty()) + add_string(menu, info.m_name); + add_string(menu, info.FormatAddress()); + add_string(menu, info.FormatTypes()); - menu.exec(e->pos()); - } + menu.exec(e->pos()); } } |