Index: broken_edge.cc
===================================================================
--- broken_edge.cc	(revision 19)
+++ broken_edge.cc	(revision 20)
@@ -18,23 +18,40 @@
 }
 
-void BrokenEdge::set_points(Gnome::Canvas::Points p)
+void BrokenEdge::set_points(Gnome::Canvas::Points p, bool move)
 {
   bool set_arrow=false;
-  if(p.size()==2)
+  if(!move)
     {
-      set_arrow=true;
-      Gnome::Canvas::Points points_with_center;
-      points_with_center.push_back(my_points[0]=p[0]);
-      points_with_center.push_back(my_points[1]=Gnome::Art::Point( (p[0].get_x()+p[1].get_x())/2+0 , (p[0].get_y()+p[1].get_y())/2 )+0 );
-      points_with_center.push_back(my_points[2]=p[1]);
-      property_points().set_value(points_with_center);
-    }  
-  if(p.size()==3)
+      if(p.size()==2)
+	{
+	  set_arrow=true;
+	  Gnome::Canvas::Points points_with_center;
+	  points_with_center.push_back(my_points[0]=p[0]);
+	  points_with_center.push_back(my_points[1]=Gnome::Art::Point( (p[0].get_x()+p[1].get_x())/2+0 , (p[0].get_y()+p[1].get_y())/2 )+0 );
+	  points_with_center.push_back(my_points[2]=p[1]);
+	  property_points().set_value(points_with_center);
+	}  
+      if(p.size()==3)
+	{
+	  set_arrow=true;
+	  property_points().set_value(p);
+	  for(int i=0;i<3;i++)
+	    {
+	      my_points[i]=p[i];
+	    }
+	}
+    }
+  else
     {
-      set_arrow=true;
-      property_points().set_value(p);
-      for(int i=0;i<3;i++)
+      if(p.size()==2)
 	{
-	  my_points[i]=p[i];
+	  Gnome::Canvas::Points points;
+	  my_points[0]=p[0];
+	  my_points[2]=p[1];
+	  for(int i=0;i<3;i++)
+	    {
+	      points.push_back(my_points[i]);
+	    }
+	  property_points().set_value(points);
 	}
     }
Index: broken_edge.h
===================================================================
--- broken_edge.h	(revision 19)
+++ broken_edge.h	(revision 20)
@@ -25,5 +25,5 @@
   BrokenEdge(Gnome::Canvas::Group &, Gnome::Canvas::Points);
   ~BrokenEdge();
-  void set_points(Gnome::Canvas::Points);
+  void set_points(Gnome::Canvas::Points, bool move=false);
 };
 
Index: graph_displayer_canvas.cc
===================================================================
--- graph_displayer_canvas.cc	(revision 19)
+++ graph_displayer_canvas.cc	(revision 20)
@@ -3,5 +3,5 @@
 #include <math.h>
 
-GraphDisplayerCanvas::GraphDisplayerCanvas(Graph & gr, CoordinatesMap & cm, MapStorage & ms):g(gr),nodesmap(g),edgesmap(g),edgetextmap(g),displayed_graph(*(root()), 0, 0),mapstorage(ms),isbutton(false),active_item(NULL),target_item(NULL)
+GraphDisplayerCanvas::GraphDisplayerCanvas(Graph & gr, CoordinatesMap & cm, MapStorage & ms):g(gr),nodesmap(g),edgesmap(g),edgetextmap(g),displayed_graph(*(root()), 0, 0),mapstorage(ms),isbutton(0),active_item(NULL),target_item(NULL)
 {
   
@@ -182,8 +182,8 @@
       clicked_y=e->button.y;
       active_item=(get_item_at(e->button.x, e->button.y));
-      isbutton=true;
+      isbutton=1;
       break;
     case GDK_BUTTON_RELEASE:
-      isbutton=false;
+      isbutton=0;
       active_item=NULL;
       updateScrollRegion();
@@ -351,8 +351,16 @@
 	    }
 	}
-      isbutton=true;
+      switch(e->button.button)
+	{
+	case 3:      
+	  isbutton=3;
+	  break;
+	default:
+	  isbutton=1;
+	  break;
+	}
       break;
     case GDK_BUTTON_RELEASE:
-      isbutton=false;
+      isbutton=0;
       active_item=NULL;
       active_node=INVALID;
@@ -377,45 +385,59 @@
 
 	//all the edges connected to the moved point has to be redrawn
-        EdgeIt e;
-
-        g.firstOut(e,active_node);
-
-        for(;e!=INVALID;g.nextOut(e))
+        EdgeIt ei;
+
+        g.firstOut(ei,active_node);
+
+        for(;ei!=INVALID;g.nextOut(ei))
         {
             Gnome::Canvas::Points coos;
             double x1, x2, y1, y2;
 
-            nodesmap[g.source(e)]->get_bounds(x1, y1, x2, y2);
+            nodesmap[g.source(ei)]->get_bounds(x1, y1, x2, y2);
             coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
 
-            nodesmap[g.target(e)]->get_bounds(x1, y1, x2, y2);
+            nodesmap[g.target(ei)]->get_bounds(x1, y1, x2, y2);
             coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
 
-            edgesmap[e]->set_points(coos);
-
-	    edgesmap[e]->get_bounds(x1, y1, x2, y2);
-
-	    edgetextmap[e]->property_x().set_value((x1+x2)/2);
-	    edgetextmap[e]->property_y().set_value((y1+y2)/2);
+	    if(isbutton==3)
+	      {
+		edgesmap[ei]->set_points(coos);
+	      }
+	    else
+	      {
+		edgesmap[ei]->set_points(coos,true);
+	      }
+
+	    edgesmap[ei]->get_bounds(x1, y1, x2, y2);
+
+	    edgetextmap[ei]->property_x().set_value((x1+x2)/2);
+	    edgetextmap[ei]->property_y().set_value((y1+y2)/2);
         }
 
-        g.firstIn(e,active_node);
-        for(;e!=INVALID;g.nextIn(e))
+        g.firstIn(ei,active_node);
+        for(;ei!=INVALID;g.nextIn(ei))
         {
             Gnome::Canvas::Points coos;
             double x1, x2, y1, y2;
 
-            nodesmap[g.source(e)]->get_bounds(x1, y1, x2, y2);
+            nodesmap[g.source(ei)]->get_bounds(x1, y1, x2, y2);
             coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
 
-            nodesmap[g.target(e)]->get_bounds(x1, y1, x2, y2);
+            nodesmap[g.target(ei)]->get_bounds(x1, y1, x2, y2);
             coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
 
-            edgesmap[e]->set_points(coos);
-
-	    edgesmap[e]->get_bounds(x1, y1, x2, y2);
-
-	    edgetextmap[e]->property_x().set_value((x1+x2)/2);
-	    edgetextmap[e]->property_y().set_value((y1+y2)/2);
+	    if(isbutton==3)
+	      {
+		edgesmap[ei]->set_points(coos);
+	      }
+	    else
+	      {
+		edgesmap[ei]->set_points(coos,true);
+	      }
+
+	    edgesmap[ei]->get_bounds(x1, y1, x2, y2);
+
+	    edgetextmap[ei]->property_x().set_value((x1+x2)/2);
+	    edgetextmap[ei]->property_y().set_value((y1+y2)/2);
         }
       }
@@ -433,5 +455,5 @@
       //draw the new node in red at the clicked place
     case GDK_BUTTON_PRESS:
-      isbutton=true;
+      isbutton=1;
 
       active_node=NodeIt(g,g.addNode());
@@ -461,5 +483,5 @@
       //finalize the new node
     case GDK_BUTTON_RELEASE:
-      isbutton=false;
+      isbutton=0;
       *active_item << Gnome::Canvas::Properties::fill_color("blue");
       active_item=NULL;
@@ -500,5 +522,5 @@
 		{
 		  *(nodesmap[active_node]) << Gnome::Canvas::Properties::fill_color("red");
-		  isbutton=true;
+		  isbutton=1;
 		}
 	      //clicked item was not a node. It could be e.g. edge.
@@ -565,5 +587,5 @@
       break;
     case GDK_BUTTON_RELEASE:
-      isbutton=false;
+      isbutton=0;
       //we clear settings in two cases
       //1: the edge is ready (target_item has valid value)
Index: graph_displayer_canvas.h
===================================================================
--- graph_displayer_canvas.h	(revision 19)
+++ graph_displayer_canvas.h	(revision 20)
@@ -97,5 +97,5 @@
 
   ///Indicates whether the button of mouse is pressed or not
-  bool isbutton;
+  int isbutton;
 
   ///At this location was the mousebutton pressed.
