COIN-OR::LEMON - Graph Library

Changeset 1500:a222eb109e52 in lemon-0.x for gui/broken_edge.cc


Ignore:
Timestamp:
06/16/05 20:58:15 (15 years ago)
Author:
Hegyi Péter
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1981
Message:

First of all: revision 1981 is mine, what is important me because I was born in 1981. But what is new in my revision? If you drag nodes with left button, edge-breakpoints do not change location. If you drag nodes by right button, they do, they take up their base situation at the halfpoint of the edge.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gui/broken_edge.cc

    r1499 r1500  
    1818}
    1919
    20 void BrokenEdge::set_points(Gnome::Canvas::Points p)
     20void BrokenEdge::set_points(Gnome::Canvas::Points p, bool move)
    2121{
    2222  bool set_arrow=false;
    23   if(p.size()==2)
     23  if(!move)
    2424    {
    25       set_arrow=true;
    26       Gnome::Canvas::Points points_with_center;
    27       points_with_center.push_back(my_points[0]=p[0]);
    28       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 );
    29       points_with_center.push_back(my_points[2]=p[1]);
    30       property_points().set_value(points_with_center);
    31     } 
    32   if(p.size()==3)
     25      if(p.size()==2)
     26        {
     27          set_arrow=true;
     28          Gnome::Canvas::Points points_with_center;
     29          points_with_center.push_back(my_points[0]=p[0]);
     30          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 );
     31          points_with_center.push_back(my_points[2]=p[1]);
     32          property_points().set_value(points_with_center);
     33        } 
     34      if(p.size()==3)
     35        {
     36          set_arrow=true;
     37          property_points().set_value(p);
     38          for(int i=0;i<3;i++)
     39            {
     40              my_points[i]=p[i];
     41            }
     42        }
     43    }
     44  else
    3345    {
    34       set_arrow=true;
    35       property_points().set_value(p);
    36       for(int i=0;i<3;i++)
     46      if(p.size()==2)
    3747        {
    38           my_points[i]=p[i];
     48          Gnome::Canvas::Points points;
     49          my_points[0]=p[0];
     50          my_points[2]=p[1];
     51          for(int i=0;i<3;i++)
     52            {
     53              points.push_back(my_points[i]);
     54            }
     55          property_points().set_value(points);
    3956        }
    4057    }
Note: See TracChangeset for help on using the changeset viewer.