src/canvas.cpp

changeset 1123
15e46ea3151f
parent 1110
ec3ee7da7806
child 1129
2b20261dc511
--- a/src/canvas.cpp	Fri Feb 10 23:06:24 2017 +0200
+++ b/src/canvas.cpp	Sun Feb 12 16:02:02 2017 +0200
@@ -51,7 +51,7 @@
 	}
 #endif
 
-	if (camera() != FreeCamera)
+	if (camera() != Camera::Free)
 	{
 		// Paint the coordinates onto the screen.
 		QString text = format(tr("X: %1, Y: %2, Z: %3"), m_position3D[X], m_position3D[Y], m_position3D[Z]);
@@ -101,8 +101,8 @@
 	m_currentEditMode = AbstractEditMode::createByType(this, a);
 
 	// If we cannot use the free camera, use the top one instead.
-	if (camera() == FreeCamera and not m_currentEditMode->allowFreeCamera())
-		setCamera(TopCamera);
+	if (camera() == Camera::Free and not m_currentEditMode->allowFreeCamera())
+		setCamera(Camera::Top);
 
 	m_window->updateEditModeActions();
 	update();
@@ -234,16 +234,16 @@
 //
 void Canvas::setDepthValue (double depth)
 {
-	if (camera() < FreeCamera)
-		m_depthValues[camera()] = depth;
+	if (camera() < Camera::Free)
+		m_depthValues[static_cast<int>(camera())] = depth;
 }
 
 // =============================================================================
 //
 double Canvas::getDepthValue() const
 {
-	if (camera() < FreeCamera)
-		return m_depthValues[camera()];
+	if (camera() < Camera::Free)
+		return m_depthValues[static_cast<int>(camera())];
 	else
 		return 0.0;
 }
@@ -253,7 +253,7 @@
  */
 Vertex Canvas::convert2dTo3d(const QPoint& position2d, bool snap) const
 {
-	if (camera() == FreeCamera)
+	if (camera() == Camera::Free)
 	{
 		return {0, 0, 0};
 	}
@@ -294,7 +294,7 @@
  */
 QPoint Canvas::convert3dTo2d(const Vertex& position3d) const
 {
-	if (camera() == FreeCamera)
+	if (camera() == Camera::Free)
 	{
 		return {0, 0};
 	}

mercurial