Author: Nikita Kitaev <[email protected]>
Date: Sun Mar 20 21:26:08 2011 -0700
Delete guides when dragged back into the rulers
---
synfig-studio/src/gui/workarea.cpp | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/synfig-studio/src/gui/workarea.cpp
b/synfig-studio/src/gui/workarea.cpp
index b6dd855..0fc48a1 100644
--- a/synfig-studio/src/gui/workarea.cpp
+++ b/synfig-studio/src/gui/workarea.cpp
@@ -1646,6 +1646,30 @@ WorkArea::on_drawing_area_event(GdkEvent *event)
if(dragging==DRAG_GUIDE)
{
+ double y,x;
+ if(event->button.axes)
+ {
+ x=(event->button.axes[0]);
+ y=(event->button.axes[1]);
+ }
+ else
+ {
+ x=event->button.x;
+ y=event->button.y;
+ }
+
+ // Erase the guides if dragged into the rulers
+ if(curr_guide_is_x && !isnan(x) && x<0.0 )
+ {
+ get_guide_list_x().erase(curr_guide);
+ }
+ else if(!curr_guide_is_x && !isnan(y) && y<0.0 )
+ {
+ get_guide_list_y().erase(curr_guide);
+ }
+
+ drawing_area->queue_draw();
+
dragging=DRAG_NONE;
save_meta_data();
return true;
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl