diff options
author | vng <viktor.govako@gmail.com> | 2014-09-06 20:07:12 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:26:11 +0300 |
commit | 7a54c6e0801cfab379816ac93b474cb68e10beb0 (patch) | |
tree | f96ed040f8eac68f0cb962ee705558fe097c0ebb /map/ruler.cpp | |
parent | 696fde40b3f9d5f5e393f76cfb57680de7a3a829 (diff) |
Minor refactoring of OverlayElement and it’s inheritors: do not store rough rect and vector of any rects by default.
Diffstat (limited to 'map/ruler.cpp')
-rw-r--r-- | map/ruler.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/map/ruler.cpp b/map/ruler.cpp index e349da40f8..2f8eedcd56 100644 --- a/map/ruler.cpp +++ b/map/ruler.cpp @@ -445,8 +445,7 @@ Ruler::Params::Params() {} Ruler::Ruler(Params const & p) - : base_t(p), - m_boundRects(1), + : BaseT(p), m_currentRangeIndex(InvalidUnitValue), m_currSystem(0), m_framework(p.m_framework) @@ -615,20 +614,13 @@ void Ruler::update() frame->SetOrgPoint(orgPt); } -vector<m2::AnyRectD> const & Ruler::boundRects() const +m2::RectD Ruler::GetBoundRect() const { - if (isDirtyRect()) - { - FontDesc const & f = font(EActive); - RulerFrame * frame = GetMainFrame(); - m2::PointD org = frame->GetOrgPoint(); - m2::PointD size = m2::PointD(CacheLength * frame->GetScale(), f.m_size * 2); - m2::RectD rect(org - m2::PointD(size.x, 0.0), org + m2::PointD(0.0, size.y)); - m_boundRects[0] = m2::AnyRectD(rect); - setIsDirtyRect(false); - } - - return m_boundRects; + FontDesc const & f = font(EActive); + RulerFrame * frame = GetMainFrame(); + m2::PointD const org = frame->GetOrgPoint(); + m2::PointD const size = m2::PointD(CacheLength * frame->GetScale(), f.m_size * 2); + return m2::RectD(org - m2::PointD(size.x, 0.0), org + m2::PointD(0.0, size.y)); } void Ruler::cache() |