]> Shamusworld >> Repos - architektonas/blobdiff - src/line.cpp
Fixed duplicate Connection issue.
[architektonas] / src / line.cpp
index 060868562a8299c3d335bb849f3657d4a0d7417c..8fc9b9c83f3e764940dc07dece9a67457f73a3cb 100644 (file)
@@ -52,6 +52,16 @@ Line::~Line()
        // connect to this dimension object at this point, instead of just becoming
        // detached.
 #endif
+//actually not true, we know the object pointer and parameter!
+//actuall, the Object base class does this for us...!
+#if 0
+       std::vector<Connection>::iterator i;
+
+       for(i=connected.begin(); i!=connected.end(); i++)
+       {
+               (*i).object->Disconnect(this, (*i).t);
+       }
+#endif
 }
 
 
@@ -306,14 +316,8 @@ a dimension only) Draw() function... :-/
        if (selectionInProgress)
        {
                // Check for whether or not the rect contains this line
-#if 0
-               if (selection.normalized().contains(Extents()))
-#else
-//             if (selection.normalized().contains(position.x, position.y)
-//                     && selection.normalized().contains(endpoint.x, endpoint.y))
                if (selection.contains(position.x, position.y)
                        && selection.contains(endpoint.x, endpoint.y))
-#endif
                        state = OSSelected;
                else
                        state = OSInactive;
@@ -353,6 +357,8 @@ a dimension only) Draw() function... :-/
                        {
                                if ((*i).object->type == OTLine)
                                        ((Line *)((*i).object))->MovePointAtParameter((*i).t, delta);
+                               else if ((*i).object->type == OTDimension)
+                                       ((Dimension *)((*i).object))->MovePointAtParameter((*i).t, delta);
                        }
                }
        }
@@ -652,6 +658,9 @@ void Line::SetDimensionOnLine(Dimension * dimension/*= NULL*/)
        // Make sure the Dimension is connected to us...
        Connect(dimension, 0);
        Connect(dimension, 1.0);
+
+       dimension->position = position;
+       dimension->endpoint = endpoint;
 }