src/ldObject.cc

changeset 717
fdc285e5952f
parent 714
b4a990f59a5e
child 719
f2cc5964f52d
--- a/src/ldObject.cc	Thu Apr 17 21:51:59 2014 +0300
+++ b/src/ldObject.cc	Fri Apr 18 18:46:25 2014 +0300
@@ -354,7 +354,6 @@
 	data->id = id();
 	data->num = num;
 	data->color = color();
-	data->origin = origin();
 
 	for (int i = 0; i < data->numVertices(); ++i)
 		data->vertices[i] = vertex (i);
@@ -733,6 +732,9 @@
 //
 void LDObject::setVertex (int i, const Vertex& vert)
 {
+	if (document() != null)
+		document()->vertexChanged (*m_coords[i], vert);
+
 	changeProperty (this, &m_coords[i], LDSharedVertex::getSharedVertex (vert));
 }
 
@@ -740,7 +742,13 @@
 //
 void LDMatrixObject::setPosition (const Vertex& a)
 {
+	if (linkPointer()->document() != null)
+		linkPointer()->document()->removeKnownVerticesOf (linkPointer());
+
 	changeProperty (linkPointer(), &m_position, LDSharedVertex::getSharedVertex (a));
+
+	if (linkPointer()->document() != null)
+		linkPointer()->document()->addKnownVerticesOf (linkPointer());
 }
 
 // =============================================================================
@@ -866,12 +874,6 @@
 	*/
 
 	LDObject* copy = parseLine (asText());
-
-	if (origin().isEmpty() == false)
-		copy->setOrigin (origin());
-	elif (document() != null)
-		copy->setOrigin (document()->getDisplayName() + ":" + QString::number (lineNumber()));
-
 	return copy;
 }
 

mercurial