Author: Nikita Kitaev <[email protected]>
Date:   Wed Jun  8 21:40:29 2011 -0700

Don't drag guides if guides are disabled

---

 synfig-studio/src/gui/workarea.cpp |   36 +++++++++++++++++++-----------------
 1 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/synfig-studio/src/gui/workarea.cpp 
b/synfig-studio/src/gui/workarea.cpp
index 37eed4b..d13e6ce 100644
--- a/synfig-studio/src/gui/workarea.cpp
+++ b/synfig-studio/src/gui/workarea.cpp
@@ -1472,23 +1472,25 @@ WorkArea::on_drawing_area_event(GdkEvent *event)
 */
 
                                // Check for a guide click
-                               GuideList::iterator iter;
-
-                               iter=find_guide_x(mouse_pos,radius);
-                               if(iter==get_guide_list_x().end())
-                               {
-                                       curr_guide_is_x=false;
-                                       iter=find_guide_y(mouse_pos,radius);
-                               }
-                               else
-                                       curr_guide_is_x=true;
-                               if(iter!=get_guide_list_x().end() && 
iter!=get_guide_list_y().end())
+                               if (show_guides)
                                {
-                                       dragging=DRAG_GUIDE;
-                                       curr_guide=iter;
-                                       return true;
-                               }
+                                       GuideList::iterator iter;
 
+                                       iter=find_guide_x(mouse_pos,radius);
+                                       if(iter==get_guide_list_x().end())
+                                       {
+                                               curr_guide_is_x=false;
+                                               
iter=find_guide_y(mouse_pos,radius);
+                                       }
+                                       else
+                                               curr_guide_is_x=true;
+                                       if(iter!=get_guide_list_x().end() && 
iter!=get_guide_list_y().end())
+                                       {
+                                               dragging=DRAG_GUIDE;
+                                               curr_guide=iter;
+                                               return true;
+                                       }
+                               }
                                // All else fails, try making a selection box
                                dragging=DRAG_BOX;
                                curr_point=drag_point=mouse_pos;
@@ -1965,7 +1967,7 @@ WorkArea::on_hruler_event(GdkEvent *event)
        switch(event->type)
     {
        case GDK_BUTTON_PRESS:
-               if(dragging==DRAG_NONE)
+               if(dragging==DRAG_NONE && show_guides)
                {
                        dragging=DRAG_GUIDE;
                        
curr_guide=get_guide_list_y().insert(get_guide_list_y().begin(), 0.0);
@@ -2025,7 +2027,7 @@ WorkArea::on_vruler_event(GdkEvent *event)
        switch(event->type)
     {
        case GDK_BUTTON_PRESS:
-               if(dragging==DRAG_NONE)
+               if(dragging==DRAG_NONE && show_guides)
                {
                        dragging=DRAG_GUIDE;
                        
curr_guide=get_guide_list_x().insert(get_guide_list_x().begin(),0.0);


------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to