- grid-snap the drawn circle radius, not the point used for the distance calculation

Mon, 05 May 2014 02:19:35 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Mon, 05 May 2014 02:19:35 +0300
changeset 763
b682c73492f0
parent 762
d259256e1394
child 764
335d929c673e

- grid-snap the drawn circle radius, not the point used for the distance calculation

src/glRenderer.cc file | annotate | diff | comparison | revisions
--- a/src/glRenderer.cc	Sat May 03 00:36:50 2014 +0300
+++ b/src/glRenderer.cc	Mon May 05 02:19:35 2014 +0300
@@ -1622,13 +1622,12 @@
 double GLRenderer::getCircleDrawDist (int pos) const
 {
 	assert (m_drawedVerts.size() >= pos + 1);
-	const Vertex& v1 = (m_drawedVerts.size() >= pos + 2) ? m_drawedVerts[pos + 1] : m_hoverpos;
+	Vertex v1 = (m_drawedVerts.size() >= pos + 2) ? m_drawedVerts[pos + 1] : coordconv2_3 (m_pos, false);
 	Axis relX, relY;
 	getRelativeAxes (relX, relY);
-
-	const double dx = m_drawedVerts[0][relX] - v1[relX];
-	const double dy = m_drawedVerts[0][relY] - v1[relY];
-	return sqrt ((dx * dx) + (dy * dy));
+	double dx = m_drawedVerts[0][relX] - v1[relX];
+	double dy = m_drawedVerts[0][relY] - v1[relY];
+	return Grid::snap (sqrt ((dx * dx) + (dy * dy)), Grid::Coordinate);
 }
 
 // =============================================================================

mercurial