Index: graph_displayer_canvas-event.cc
===================================================================
--- graph_displayer_canvas-event.cc	(revision 147)
+++ graph_displayer_canvas-event.cc	(revision 148)
@@ -102,13 +102,5 @@
 	    }
 	}
-      switch(e->button.button)
-	{
-	case 3:      
-	  isbutton=3;
-	  break;
-	default:
-	  isbutton=1;
-	  break;
-	}
+      isbutton=e->button.button;
       break;
     case GDK_BUTTON_RELEASE:
@@ -192,8 +184,5 @@
 
             XY arrow_pos;
-	    if(isbutton==3)
-              arrow_pos = calcArrowPos(moved_node_1, moved_node_2, fix_node, old_arrow_pos, false);
-	    else
-              arrow_pos = calcArrowPos(moved_node_1, moved_node_2, fix_node, old_arrow_pos, true);
+	    arrow_pos = calcArrowPos(moved_node_1, moved_node_2, fix_node, old_arrow_pos, isbutton);
 
             mytab.mapstorage.arrow_pos.set(ei, arrow_pos);
@@ -217,8 +206,5 @@
 
             XY arrow_pos;
-	    if(isbutton==3)
-              arrow_pos = calcArrowPos(moved_node_1, moved_node_2, fix_node, old_arrow_pos, false);
-	    else
-              arrow_pos = calcArrowPos(moved_node_1, moved_node_2, fix_node, old_arrow_pos, true);
+	    arrow_pos = calcArrowPos(moved_node_1, moved_node_2, fix_node, old_arrow_pos, isbutton);
 
             mytab.mapstorage.arrow_pos.set(ei, arrow_pos);
@@ -238,55 +224,64 @@
 }
 
-XY GraphDisplayerCanvas::calcArrowPos(XY moved_node_1, XY moved_node_2, XY fix_node, XY old_arrow_pos, bool move)
-{
-  if(!move)
-  {
-    return XY((moved_node_2.x + fix_node.x) / 2.0, (moved_node_2.y + fix_node.y) / 2.0);
-  }
-  else
-  {
-    //////////////////////////////////////////////////////////////////////////////////////////////////////
-    /////////// keeps shape-with scalar multiplication - version 2.
-    //////////////////////////////////////////////////////////////////////////////////////////////////////
-
-    //old vector from one to the other node - a
-    xy<double> a_v(moved_node_1.x-fix_node.x,moved_node_1.y-fix_node.y);
-    //new vector from one to the other node - b
-    xy<double> b_v(moved_node_2.x-fix_node.x,moved_node_2.y-fix_node.y);
-
-    double absa=sqrt(a_v.normSquare());
-    double absb=sqrt(b_v.normSquare());
-
-    if ((absa == 0.0) || (absb == 0.0))
+XY GraphDisplayerCanvas::calcArrowPos(XY moved_node_1, XY moved_node_2, XY fix_node, XY old_arrow_pos, int move_code)
+{
+  switch(move_code)
     {
+    case 1:
+      return XY((moved_node_2.x + fix_node.x) / 2.0, (moved_node_2.y + fix_node.y) / 2.0);
+      break;
+    case 2:
       return old_arrow_pos;
+      break;
+    case 3:
+      {
+	//////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////// keeps shape-with scalar multiplication - version 2.
+	//////////////////////////////////////////////////////////////////////////////////////////////////////
+
+	//old vector from one to the other node - a
+	xy<double> a_v(moved_node_1.x-fix_node.x,moved_node_1.y-fix_node.y);
+	//new vector from one to the other node - b
+	xy<double> b_v(moved_node_2.x-fix_node.x,moved_node_2.y-fix_node.y);
+
+	double absa=sqrt(a_v.normSquare());
+	double absb=sqrt(b_v.normSquare());
+
+	if ((absa == 0.0) || (absb == 0.0))
+	  {
+	    return old_arrow_pos;
+	  }
+	else
+	  {
+	    //old vector from one node to the breakpoint - c
+	    xy<double> c_v(old_arrow_pos.x-fix_node.x,old_arrow_pos.y-fix_node.y);
+
+	    //unit vector with the same direction to a_v
+	    xy<double> a_v_u(a_v.x/absa,a_v.y/absa);
+
+	    //normal vector of unit vector with the same direction to a_v
+	    xy<double> a_v_u_n(((-1)*a_v_u.y),a_v_u.x);
+
+	    //unit vector with the same direction to b_v
+	    xy<double> b_v_u(b_v.x/absb,b_v.y/absb);
+
+	    //normal vector of unit vector with the same direction to b_v
+	    xy<double> b_v_u_n(((-1)*b_v_u.y),b_v_u.x);
+
+	    //vector c in a_v_u and a_v_u_n co-ordinate system
+	    xy<double> c_a(c_v*a_v_u,c_v*a_v_u_n);
+
+	    //new vector from one node to the breakpoint - d - we have to calculate this one
+	    xy<double> d_v=absb/absa*(c_a.x*b_v_u+c_a.y*b_v_u_n);
+
+	    return XY(d_v.x+fix_node.x,d_v.y+fix_node.y);
+	  }
+	break;
+      }
+    default:
+      break;
     }
-    else
-    {
-      //old vector from one node to the breakpoint - c
-      xy<double> c_v(old_arrow_pos.x-fix_node.x,old_arrow_pos.y-fix_node.y);
-
-      //unit vector with the same direction to a_v
-      xy<double> a_v_u(a_v.x/absa,a_v.y/absa);
-
-      //normal vector of unit vector with the same direction to a_v
-      xy<double> a_v_u_n(((-1)*a_v_u.y),a_v_u.x);
-
-      //unit vector with the same direction to b_v
-      xy<double> b_v_u(b_v.x/absb,b_v.y/absb);
-
-      //normal vector of unit vector with the same direction to b_v
-      xy<double> b_v_u_n(((-1)*b_v_u.y),b_v_u.x);
-
-      //vector c in a_v_u and a_v_u_n co-ordinate system
-      xy<double> c_a(c_v*a_v_u,c_v*a_v_u_n);
-
-      //new vector from one node to the breakpoint - d - we have to calculate this one
-      xy<double> d_v=absb/absa*(c_a.x*b_v_u+c_a.y*b_v_u_n);
-
-      return XY(d_v.x+fix_node.x,d_v.y+fix_node.y);
-    }
-  }
-}
+}
+
 
 bool GraphDisplayerCanvas::createNodeEventHandler(GdkEvent* e)
