src/actionsEdit.cc

changeset 780
b0d84fb70ea5
parent 769
8bb3bed44570
child 786
71d786ce0dcc
--- a/src/actionsEdit.cc	Wed May 21 19:00:57 2014 +0300
+++ b/src/actionsEdit.cc	Thu May 22 18:01:19 2014 +0300
@@ -36,6 +36,9 @@
 
 EXTERN_CFGENTRY (String, defaultUser);
 
+CFGENTRY (Int,	roundPosition,	3);
+CFGENTRY (Int,	roundMatrix,	4);
+
 // =============================================================================
 //
 static int copyToClipboard()
@@ -532,8 +535,8 @@
 			Matrix t = mo->transform();
 
 			// Note: matrix values are to be rounded to 4 decimals.
-			v.apply ([](Axis, double& a) { roundToDecimals (a, 3); });
-			applyToMatrix (t, [](int, double& a) { roundToDecimals (a, 4); });
+			v.apply ([](Axis, double& a) { roundToDecimals (a, cfg::roundPosition); });
+			applyToMatrix (t, [](int, double& a) { roundToDecimals (a, cfg::roundMatrix); });
 
 			mo->setPosition (v);
 			mo->setTransform (t);
@@ -544,7 +547,7 @@
 			for (int i = 0; i < obj->numVertices(); ++i)
 			{
 				Vertex v = obj->vertex (i);
-				v.apply ([](Axis, double& a) { roundToDecimals (a, 3); });
+				v.apply ([](Axis, double& a) { roundToDecimals (a, cfg::roundPosition); });
 				obj->setVertex (i, v);
 				num += 3;
 			}

mercurial