src/ldObject.cc

changeset 717
fdc285e5952f
parent 714
b4a990f59a5e
child 719
f2cc5964f52d
equal deleted inserted replaced
716:639a900999bc 717:fdc285e5952f
352 352
353 LDPolygon* data = new LDPolygon; 353 LDPolygon* data = new LDPolygon;
354 data->id = id(); 354 data->id = id();
355 data->num = num; 355 data->num = num;
356 data->color = color(); 356 data->color = color();
357 data->origin = origin();
358 357
359 for (int i = 0; i < data->numVertices(); ++i) 358 for (int i = 0; i < data->numVertices(); ++i)
360 data->vertices[i] = vertex (i); 359 data->vertices[i] = vertex (i);
361 360
362 return data; 361 return data;
731 730
732 // ============================================================================= 731 // =============================================================================
733 // 732 //
734 void LDObject::setVertex (int i, const Vertex& vert) 733 void LDObject::setVertex (int i, const Vertex& vert)
735 { 734 {
735 if (document() != null)
736 document()->vertexChanged (*m_coords[i], vert);
737
736 changeProperty (this, &m_coords[i], LDSharedVertex::getSharedVertex (vert)); 738 changeProperty (this, &m_coords[i], LDSharedVertex::getSharedVertex (vert));
737 } 739 }
738 740
739 // ============================================================================= 741 // =============================================================================
740 // 742 //
741 void LDMatrixObject::setPosition (const Vertex& a) 743 void LDMatrixObject::setPosition (const Vertex& a)
742 { 744 {
745 if (linkPointer()->document() != null)
746 linkPointer()->document()->removeKnownVerticesOf (linkPointer());
747
743 changeProperty (linkPointer(), &m_position, LDSharedVertex::getSharedVertex (a)); 748 changeProperty (linkPointer(), &m_position, LDSharedVertex::getSharedVertex (a));
749
750 if (linkPointer()->document() != null)
751 linkPointer()->document()->addKnownVerticesOf (linkPointer());
744 } 752 }
745 753
746 // ============================================================================= 754 // =============================================================================
747 // 755 //
748 void LDMatrixObject::setTransform (const Matrix& val) 756 void LDMatrixObject::setTransform (const Matrix& val)
864 } 872 }
865 } 873 }
866 */ 874 */
867 875
868 LDObject* copy = parseLine (asText()); 876 LDObject* copy = parseLine (asText());
869
870 if (origin().isEmpty() == false)
871 copy->setOrigin (origin());
872 elif (document() != null)
873 copy->setOrigin (document()->getDisplayName() + ":" + QString::number (lineNumber()));
874
875 return copy; 877 return copy;
876 } 878 }
877 879
878 // ============================================================================= 880 // =============================================================================
879 // 881 //

mercurial