broken_edge.cc
branchgui
changeset 23 d0e4ac77bafe
parent 20 a3bd39d50930
child 24 094ac2326a2a
equal deleted inserted replaced
2:980896b724b0 3:de790fb0767e
     1 #include <broken_edge.h>
     1 #include <broken_edge.h>
     2 #include <lemon/xy.h>
     2 #include <lemon/xy.h>
     3 #include <math.h>
     3 #include <math.h>
     4 
     4 
     5 BrokenEdge::BrokenEdge(Gnome::Canvas::Group & g, Gnome::Canvas::Points p) : Line(g), isbutton(false)
     5 BrokenEdge::BrokenEdge(Gnome::Canvas::Group & g, Gnome::Canvas::Points p, GraphDisplayerCanvas & gc) : Line(g), gdc(gc), isbutton(false)
     6 {
     6 {
     7   my_points=new Gnome::Art::Point[3];
     7   my_points=new Gnome::Art::Point[3];
     8 
     8 
     9   arrow=new Gnome::Canvas::Polygon(g);
     9   arrow=new Gnome::Canvas::Polygon(g);
    10   *arrow << Gnome::Canvas::Properties::fill_color("red");
    10   *arrow << Gnome::Canvas::Properties::fill_color("red");
   108 {
   108 {
   109   switch(e->type)
   109   switch(e->type)
   110     {
   110     {
   111     case GDK_BUTTON_PRESS:
   111     case GDK_BUTTON_PRESS:
   112       //we mark the location of the event to be able to calculate parameters of dragging
   112       //we mark the location of the event to be able to calculate parameters of dragging
   113       clicked_x=e->button.x;
   113       if(gdc.get_actual_tool()!=CREATE_NODE)
   114       clicked_y=e->button.y;
   114 	{
   115       isbutton=true;
   115 	  clicked_x=e->button.x;
       
   116 	  clicked_y=e->button.y;
       
   117 	  isbutton=true;
       
   118 	}
   116       break;
   119       break;
   117     case GDK_BUTTON_RELEASE:
   120     case GDK_BUTTON_RELEASE:
   118       isbutton=false;
   121       isbutton=false;
   119       break;
   122       break;
   120     case GDK_MOTION_NOTIFY:
   123     case GDK_MOTION_NOTIFY: