Author: Carlos Lopez <[email protected]>
Date:   Fri Mar  1 18:24:53 2013 +0100

Fix bug: mouse pan on navigator doesn't work if the cairo render is enabled for 
navigator at synfig studio start. This fixes that behavior and makes the mouse 
pan works fine.

---

 synfig-studio/src/gui/docks/dock_navigator.cpp |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/synfig-studio/src/gui/docks/dock_navigator.cpp 
b/synfig-studio/src/gui/docks/dock_navigator.cpp
index ddb635f..41d03a6 100644
--- a/synfig-studio/src/gui/docks/dock_navigator.cpp
+++ b/synfig-studio/src/gui/docks/dock_navigator.cpp
@@ -491,14 +491,24 @@ bool studio::Widget_NavView::on_mouse_event(GdkEvent * e)
                setpos = true;
        }
 
-       if(setpos && prev && get_canvas_view())
+       if(setpos && (prev||studio::App::navigator_uses_cairo) && 
get_canvas_view())
        {
                const Point &tl = 
get_canvas_view()->get_canvas()->rend_desc().get_tl();
                const Point &br = 
get_canvas_view()->get_canvas()->rend_desc().get_br();
-
+               int w,h;
+               if(prev && !studio::App::navigator_uses_cairo)
+               {
+                       w = prev->get_width();
+                       h = prev->get_height();
+               }
+               if(studio::App::navigator_uses_cairo)
+               {
+                       w=cairo_image_surface_get_width(*cairo_surface.get());
+                       h=cairo_image_surface_get_height(*cairo_surface.get());
+               }
                float max = abs((br[0]-tl[0]) / drawto.get_width());
 
-               if((float(prev->get_width()) / drawto.get_width()) < 
(float(prev->get_height()) / drawto.get_height()))
+               if((float(w) / drawto.get_width()) < (float(h) / 
drawto.get_height()))
                        max = abs((br[1]-tl[1]) / drawto.get_height());
 
                float signx = (br[0]-tl[0]) < 0 ? -1 : 1;


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to