diff options
author | vng <viktor.govako@gmail.com> | 2014-09-06 13:54:20 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:26:10 +0300 |
commit | d9ca6e56ef92b248221b66ab0f79437c573c469b (patch) | |
tree | 830f5d1ce26c3a0289fc2d8e7cfa04071d816c1c /map/compass_arrow.hpp | |
parent | 573e647de3a22282d0e993c30ffa05f4075c1e93 (diff) |
Minor refactoring of InformationDisplay:
- remove useless class data
- do not recalculate layout on every frame draw; do it when size changed only
- use unique_ptr instead of shared_ptr
- remove useless includes
Diffstat (limited to 'map/compass_arrow.hpp')
-rw-r--r-- | map/compass_arrow.hpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/map/compass_arrow.hpp b/map/compass_arrow.hpp index 03a367a652..0b4823cd07 100644 --- a/map/compass_arrow.hpp +++ b/map/compass_arrow.hpp @@ -1,8 +1,10 @@ #pragma once #include "../gui/element.hpp" -#include "../geometry/any_rect2d.hpp" + #include "../std/shared_ptr.hpp" +#include "../std/unique_ptr.hpp" + namespace anim { @@ -26,7 +28,7 @@ private: double m_angle; - graphics::DisplayList * m_displayList; + unique_ptr<graphics::DisplayList> m_dl; shared_ptr<anim::Task> m_animTask; @@ -40,8 +42,6 @@ private: Framework * m_framework; graphics::Resource const * GetCompassResource() const; - void cache(); - void purge(); bool isBaseVisible() const; public: @@ -60,12 +60,17 @@ public: void SetAngle(double angle); m2::PointD GetPixelSize() const; + /// @name Override from graphics::Overlayelement and gui::Element. + //@{ vector<m2::AnyRectD> const & boundRects() const; void draw(graphics::OverlayRenderer * r, math::Matrix<double, 3, 3> const & m) const; - virtual bool isVisible() const; - - bool onTapEnded(m2::PointD const & pt); - + bool isVisible() const; bool roughHitTest(m2::PointD const & pt) const; bool hitTest(m2::PointD const & pt) const; + + void cache(); + void purge(); + + bool onTapEnded(m2::PointD const & pt); + //@} }; |