diff options
author | rachytski <siarhei.rachytski@gmail.com> | 2012-10-08 15:54:51 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:44:51 +0300 |
commit | e19ff2ec3a00b814a5f3f8a7c2edc1e70ac3ef8a (patch) | |
tree | 257992d02b50e5d6faf47ed57e97534828b9c79d /map/compass_arrow.hpp | |
parent | 155a2cdd41a1d24d63b7587e75b6a526e35414d7 (diff) |
changes to CompassArrow according to code review.
Diffstat (limited to 'map/compass_arrow.hpp')
-rw-r--r-- | map/compass_arrow.hpp | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/map/compass_arrow.hpp b/map/compass_arrow.hpp index 777519f84a..8656320860 100644 --- a/map/compass_arrow.hpp +++ b/map/compass_arrow.hpp @@ -3,20 +3,12 @@ #include "../gui/element.hpp" #include "../yg/color.hpp" +#include "../yg/display_list.hpp" #include "../geometry/any_rect2d.hpp" -#include "../std/shared_ptr.hpp" +#include "../std/scoped_ptr.hpp" -namespace yg -{ - namespace gl - { - class DisplayList; - } -} - -class RotateScreenTask; class Framework; /// Compass Arrow, which shows up when the screen is rotated, @@ -33,19 +25,10 @@ private: yg::Color m_southColor; double m_angle; - /// @todo It's a scoped_ptr. You don't pass it outside the class. - shared_ptr<yg::gl::DisplayList> m_displayList; - - /// @todo Am I missed something? Where does this ptr initialized? - shared_ptr<RotateScreenTask> m_rotateScreenTask; + scoped_ptr<yg::gl::DisplayList> m_displayList; mutable vector<m2::AnyRectD> m_boundRects; - /// @todo I don't think that it's a good idea to store matrix as state of the class. - /// Just calculate it in the needed plase (draw()). Otherwise you should not forget - /// to recalculate it. Now it depends on pivot(), but what happens when pivot is changed? - math::Matrix<double, 3, 3> m_drawM; - Framework * m_framework; void cache(); @@ -64,7 +47,9 @@ public: CompassArrow(Params const & p); - void setAngle(double angle); + void SetAngle(double angle); + + unsigned GetArrowHeight() const; vector<m2::AnyRectD> const & boundRects() const; void draw(yg::gl::OverlayRenderer * r, math::Matrix<double, 3, 3> const & m) const; @@ -72,6 +57,4 @@ public: bool onTapEnded(m2::PointD const & pt); bool hitTest(m2::PointD const & pt) const; - - void StopAnimation(); }; |