From 5c6d5cf1b4a22ae6d35b9c081bf34afec263ba63 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Tue, 17 Mar 2015 15:58:02 -0400 Subject: Made some nice changes to the map editor widget Center the map edit widget Map edit zooming in should happen around the cursor Disallow editing outside the mapedit widget Add some scroll space around the mapedit widget --- tools/mapedit/src/widget.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tools/mapedit/src/widget.h') diff --git a/tools/mapedit/src/widget.h b/tools/mapedit/src/widget.h index 4ae22c7..77b840e 100644 --- a/tools/mapedit/src/widget.h +++ b/tools/mapedit/src/widget.h @@ -21,7 +21,7 @@ enum EditMode { EditEntities }; -class MapeditWidget : public wxScrolledWindow { +class MapeditWidget : public wxScrolledCanvas { public: MapeditWidget(); MapeditWidget(wxWindow* parent, wxWindowID winid, Map* map, TileWidget* tileWidget, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize); @@ -54,8 +54,8 @@ class MapeditWidget : public wxScrolledWindow { wxBitmap tiles; TileWidget* tileWidget; bool mouseIsDown = false; - int scale; - wxPoint mousePos; + int scale = 1; + wxPoint mousePos {GAME_WIDTH/2, GAME_HEIGHT/2}; bool mouseIsIn = false; EditMode editMode = EditTiles; int currentPlayer = 0; -- cgit 1.4.1