diff options
Diffstat (limited to 'src/View/MapView.cpp')
-rw-r--r-- | src/View/MapView.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/View/MapView.cpp b/src/View/MapView.cpp index 69c9d2f..5727c86 100644 --- a/src/View/MapView.cpp +++ b/src/View/MapView.cpp @@ -30,6 +30,34 @@ namespace ZoomEdit { namespace View { +void MapView::zoom(Gui::RenderArea*, int zoom, float, float) { + if(!mainArea) + return; + + TopView *mainView = dynamic_cast<TopView*>(mainArea->getView()); + if(!mainView) + return; + + mainView->zoom(mainArea, zoom, 0, 0); +} + +void MapView::move(Gui::RenderArea*, float x, float y, unsigned int state) { + if(!mainArea) + return; + + TopView *mainView = dynamic_cast<TopView*>(mainArea->getView()); + if(!mainView) + return; + + if(!(state & GDK_BUTTON1_MASK)) + return; + + mainView->setXCenter(mainView->getXCenter() - x/scale); + mainView->setYCenter(mainView->getYCenter() - y/scale); + + mainArea->queue_draw(); +} + void MapView::click(Gui::RenderArea *renderArea, float x, float y) { if(!mainArea) return; |