]> Shamusworld >> Repos - architektonas/blobdiff - src/container.cpp
Fixed Container loading, informative display.
[architektonas] / src / container.cpp
index ced7326de4979b91e67d4d16dfe97694101d4837..cd50d587381c4a62002d2211cad3c8436e9ecb87 100644 (file)
@@ -162,6 +162,9 @@ printf("Container::Collided: Deleting object ($%X)\n", *i);
                }
        }
 
+       if (snapToGrid)
+               point = SnapPointToGrid(point);
+
        // We check to see if the container we're trying to access is the
        // DrawingView's document. If so, we ignore the state of the container.
        // Otherwise, we care about the state of the container. :-)
@@ -499,3 +502,21 @@ void Container::ResizeAllDimensions(double newSize)
                fprintf(file, "ENDCONTAINER\n");
 }
 
+
+/*virtual*/ Object * Container::Copy(void)
+{
+#warning "!!! This doesn't take care of attached Dimensions !!!"
+/*
+This is a real problem. While having a pointer in the Dimension to this line's points
+is fast & easy, it creates a huge problem when trying to replicate an object like this.
+
+Maybe a way to fix that then, is to have reference numbers instead of pointers. That
+way, if you copy them, ... you might still have problems. Because you can't be sure if
+a copy will be persistant or not, you then *definitely* do not want them to have the
+same reference number.
+*/
+       Container * c = new Container(position, parent);
+       *c = *this;
+       return c;
+}
+