--- a/src/glcamera.cpp Mon Mar 06 00:43:43 2017 +0200 +++ b/src/glcamera.cpp Mon Mar 06 00:55:45 2017 +0200 @@ -88,7 +88,7 @@ /* * This converts a 2D point on the screen to a 3D point in the model. If 'snap' is true, the 3D point will snap to the current grid. */ -Vertex GLCamera::convert2dTo3d(const QPoint& position2d, Grid* grid) const +Vertex GLCamera::convert2dTo3d(const QPoint& position2d, bool snapToGrid) const { if (m_isFree) { @@ -105,9 +105,9 @@ double cy = m_virtualSize.height() - (2 * position2d.y() * m_virtualSize.height() / m_size.height()) - m_panningY; // If a grid was passed, snap coordinates to it. - if (grid) + if (snapToGrid) { - QPointF snapped = grid->snap({cx, cy}); + QPointF snapped = Grid::snap({cx, cy}); cx = snapped.x(); cy = snapped.y(); }