diff options
author | Stijn Buys <ingar@osirion.org> | 2012-03-18 11:01:29 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2012-03-18 11:01:29 +0000 |
commit | e3af85ab1a06742ba23c815b80887fdbf32fe36c (patch) | |
tree | a80891ff6077ff0bd95636c82516a16c9dc08cac /src/mapwidget.h | |
parent | f46146993b50ca5afc802288deeb5bd72a176d9a (diff) |
Made MapWidget::zoom() independent of the size of the widget.
Diffstat (limited to 'src/mapwidget.h')
-rw-r--r-- | src/mapwidget.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/mapwidget.h b/src/mapwidget.h index 2dde34f..d418602 100644 --- a/src/mapwidget.h +++ b/src/mapwidget.h @@ -42,6 +42,11 @@ public: inline EntityWidget *selected() { return mapwidget_selected; } + + /** + * @return the current map zoom factor + * */ + float zoom() const; protected: @@ -122,14 +127,16 @@ private slots: private: typedef QList<EntityWidget *> Entities; - int mapwidget_zoom; int dragstart_x; int dragstart_y; - int center_x; - int center_y; - bool is_dragging; + + // zoom factor, as a power of 2 + int mapwidget_zoomfactor; + + // center of the map, in world coordinates + Vector3f mapwidget_center; Entities mapwidget_enties; EntityWidget *mapwidget_selected; |