From 1d6f52984dfef698516ae3fef142c80c2029fc7b Mon Sep 17 00:00:00 2001 From: neoraider Date: Sat, 3 May 2008 13:05:01 +0000 Subject: zoomedit: * Some MapView improvements --- src/View/MapView.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/View/MapView.cpp') 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(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(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; -- cgit v1.2.3