Mon, 19 Mar 2018 10:59:58 +0200
reworked invert()
src/algorithms/invert.cpp | file | annotate | diff | comparison | revisions |
--- a/src/algorithms/invert.cpp Mon Mar 19 10:57:19 2018 +0200 +++ b/src/algorithms/invert.cpp Mon Mar 19 10:59:58 2018 +0200 @@ -91,12 +91,13 @@ if (obj->numPolygonVertices() > 0) { QVector<Vertex> vertices; - - for (int i = 0; i < obj->numPolygonVertices(); i += 1) - vertices.append(obj->vertex(i)); + vertices.resize(obj->numPolygonVertices()); for (int i = 0; i < vertices.size(); i += 1) - obj->setVertex(i, vertices[vertices.size() - 1 - i]); + vertices[vertices.size() - 1 - i] = obj->vertex(i); + + for (int i = 0; i < vertices.size(); i += 1) + obj->setVertex(i, vertices[i]); } else if (obj->type() == LDObjectType::SubfileReference) {