Integrated support for shape translation in undo commands.

This commit is contained in:
Tats
2015-07-19 22:08:59 -06:00
parent 24575c1e55
commit 4d71dc575e
6 changed files with 41 additions and 33 deletions
+3 -7
View File
@@ -31,14 +31,10 @@ MShape* MShape::clone() const {
return copyShape;
}
void MShape::translate(int x, int y)
void MShape::translate(const QPointF& offset)
{
for (QVector<QPointF>::iterator it = vertices.begin() ;
it != vertices.end(); ++it)
{
it->setX(it->x() + x);
it->setY(it->y() + y);
}
for (int i=0; i<nVertices(); i++)
setVertex(i, getVertex(i) + offset);
}
void Polygon::setVertex(int i, const QPointF& v)