| 1 | // SuperTux |
| 2 | // Copyright (C) 2016 Hume2 <teratux.mail@gmail.com> |
| 3 | // |
| 4 | // This program is free software: you can redistribute it and/or modify |
| 5 | // it under the terms of the GNU General Public License as published by |
| 6 | // the Free Software Foundation, either version 3 of the License, or |
| 7 | // (at your option) any later version. |
| 8 | // |
| 9 | // This program is distributed in the hope that it will be useful, |
| 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | // GNU General Public License for more details. |
| 13 | // |
| 14 | // You should have received a copy of the GNU General Public License |
| 15 | // along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | |
| 17 | |
| 18 | #ifndef HEADER_SUPERTUX_EDITOR_RESIZE_MARKER_HPP |
| 19 | #define |
| 20 | |
| 21 | #include "editor/marker_object.hpp" |
| 22 | |
| 23 | class ResizeMarker : public MarkerObject |
| 24 | { |
| 25 | public: |
| 26 | enum class Side { |
| 27 | NONE, |
| 28 | LEFT_UP, |
| 29 | RIGHT_DOWN |
| 30 | }; |
| 31 | |
| 32 | public: |
| 33 | ResizeMarker(Rectf* rect, Side vert, Side horz); |
| 34 | |
| 35 | virtual void move_to(const Vector& pos) override; |
| 36 | virtual Vector get_point_vector() const override; |
| 37 | virtual Vector get_offset() const override; |
| 38 | virtual bool has_settings() const override { return false; } |
| 39 | virtual void editor_update() override; |
| 40 | |
| 41 | private: |
| 42 | void refresh_pos(); |
| 43 | |
| 44 | private: |
| 45 | Rectf* m_rect; |
| 46 | Side m_vert; |
| 47 | Side m_horz; |
| 48 | |
| 49 | private: |
| 50 | ResizeMarker(const ResizeMarker&) = delete; |
| 51 | ResizeMarker& operator=(const ResizeMarker&) = delete; |
| 52 | }; |
| 53 | |
| 54 | #endif |
| 55 | |
| 56 | /* EOF */ |
| 57 | |