From: pabs Date: Wed, 15 Aug 2007 07:55:09 +0000 (+0000) Subject: Add support for scrolling left and right in the canvas window. Ctrl+LeftScroll zooms... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=f9816d45921e9b4d4b98204bff76f94d9c58cd19;p=synfig.git Add support for scrolling left and right in the canvas window. Ctrl+LeftScroll zooms out, Ctrl+RightScroll zooms in. Shift works the opposite to up-down. git-svn-id: http://svn.voria.com/code@554 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/src/gtkmm/workarea.cpp b/synfig-studio/trunk/src/gtkmm/workarea.cpp index 6c4e252..bf9cebe 100644 --- a/synfig-studio/trunk/src/gtkmm/workarea.cpp +++ b/synfig-studio/trunk/src/gtkmm/workarea.cpp @@ -1689,11 +1689,13 @@ WorkArea::on_drawing_area_event(GdkEvent *event) switch(event->scroll.direction) { case GDK_SCROLL_UP: + case GDK_SCROLL_RIGHT: get_scrollx_adjustment()->set_value(scroll_point[0]+(mouse_pos[0]-scroll_point[0])*(1.25-(1+drift))); get_scrolly_adjustment()->set_value(scroll_point[1]-(mouse_pos[1]+scroll_point[1])*(1.25-(1+drift))); zoom_in(); break; case GDK_SCROLL_DOWN: + case GDK_SCROLL_LEFT: get_scrollx_adjustment()->set_value(scroll_point[0]+(mouse_pos[0]-scroll_point[0])*(1/1.25-(1+drift))); get_scrolly_adjustment()->set_value(scroll_point[1]-(mouse_pos[1]+scroll_point[1])*(1/1.25-(1+drift))); zoom_out(); @@ -1719,6 +1721,12 @@ WorkArea::on_drawing_area_event(GdkEvent *event) case GDK_SCROLL_DOWN: get_scrollx_adjustment()->set_value(get_scrollx_adjustment()->get_value()+scroll_pixel*pw); break; + case GDK_SCROLL_LEFT: + get_scrolly_adjustment()->set_value(get_scrolly_adjustment()->get_value()+scroll_pixel*ph); + break; + case GDK_SCROLL_RIGHT: + get_scrolly_adjustment()->set_value(get_scrolly_adjustment()->get_value()-scroll_pixel*ph); + break; default: break; } @@ -1740,6 +1748,12 @@ WorkArea::on_drawing_area_event(GdkEvent *event) case GDK_SCROLL_DOWN: get_scrolly_adjustment()->set_value(get_scrolly_adjustment()->get_value()-scroll_pixel*ph); break; + case GDK_SCROLL_LEFT: + get_scrollx_adjustment()->set_value(get_scrollx_adjustment()->get_value()-scroll_pixel*pw); + break; + case GDK_SCROLL_RIGHT: + get_scrollx_adjustment()->set_value(get_scrollx_adjustment()->get_value()+scroll_pixel*pw); + break; default: break; }