src/editmodes/abstractEditMode.cpp

changeset 1320
bdb4804bc09c
parent 1319
39d7a9642eea
child 1321
413d7be6f042
--- a/src/editmodes/abstractEditMode.cpp	Sat Mar 24 11:57:24 2018 +0200
+++ b/src/editmodes/abstractEditMode.cpp	Sat Mar 24 12:06:22 2018 +0200
@@ -120,7 +120,7 @@
 		QList<Vertex> vertices = currentDocument()->inlineVertices().toList();
 
 		// Sort the vertices in order of distance to camera
-		std::sort(vertices.begin(), vertices.end(), [&](const Vertex& a, const Vertex& b) -> bool
+		sort(vertices.begin(), vertices.end(), [&](const Vertex& a, const Vertex& b) -> bool
 		{
 			if (renderer()->currentCamera().isAxisNegated(Z))
 				return a[depthAxis] > b[depthAxis];
@@ -132,16 +132,16 @@
 		{
 			// If the vertex in 2d space is very close to the cursor then we use it regardless of depth.
 			QPoint vect2d = renderer()->currentCamera().convert3dTo2d(vertex) - cursorPosition2D;
-			double distance2DSquared = std::pow(vect2d.x(), 2) + std::pow(vect2d.y(), 2);
+			double distance2DSquared = ::squared(vect2d.x()) + ::squared(vect2d.y());
 
-			if (distance2DSquared < 16.0 * 16.0)
+			if (distance2DSquared < ::squared(16.0))
 			{
 				closest = &vertex;
 				break;
 			}
 
 			// Check if too far away from the cursor.
-			if (distance2DSquared > 64.0 * 64.0)
+			if (distance2DSquared > ::squared(64.0))
 				continue;
 
 			// Not very close to the cursor. Compare using true distance,

mercurial