fix warnings

Fri, 30 Mar 2018 14:30:51 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Fri, 30 Mar 2018 14:30:51 +0300
changeset 1364
f6a3640b1818
parent 1353
48374309f3d1
child 1365
3f917410e977
child 1366
69087b1e123b

fix warnings

src/basics.cpp file | annotate | diff | comparison | revisions
src/primitives.cpp file | annotate | diff | comparison | revisions
--- a/src/basics.cpp	Thu Mar 29 10:42:45 2018 +0300
+++ b/src/basics.cpp	Fri Mar 30 14:30:51 2018 +0300
@@ -57,11 +57,13 @@
 
 double roundToDecimals(double value, int decimals)
 {
+	decimals = max(0, decimals);
+
 	if (decimals == 0)
 	{
 		return round(value);
 	}
-	else if (decimals > 0)
+	else
 	{
 		qreal coefficient = pow(10, decimals);
 		return round(value * coefficient) / coefficient;
--- a/src/primitives.cpp	Thu Mar 29 10:42:45 2018 +0300
+++ b/src/primitives.cpp	Fri Mar 30 14:30:51 2018 +0300
@@ -418,6 +418,9 @@
 				segment->setVertex(type == Disc ? 2 : 0, v2);
 			}
 			break;
+
+		case Cylinder:
+			break;
 		}
 	}
 

mercurial