# HG changeset patch # User Santeri Piippo # Date 1400770879 -10800 # Node ID b0d84fb70ea5806e18cdbc776c58dec98e2f13c1 # Parent 23130cafe95edd6d4dbf38087a94e96ded7d8545 - made coordinate rounding precision configurable diff -r 23130cafe95e -r b0d84fb70ea5 changelog.txt --- a/changelog.txt Wed May 21 19:00:57 2014 +0300 +++ b/changelog.txt Thu May 22 18:01:19 2014 +0300 @@ -33,6 +33,7 @@ + - Vertex snapping is now smarter, does a depth comparison to favor vertices closer to camera. Selecting a vertex very close with the cursor still allows selecting vertices far away from the camera. This makes it less likely to pick irrelevant vertices which caused problems in part files. + - Added a selection hover effect to the renderer, making selecting objects a lot more convenient. + - Selecting an invertnext'd object now also selects the invertnext. ++ - Made the coordinate rounding precision configurable. - - The camera is now changed to the top one if switching to draw mode while using the free camera instead of disabling the draw mode. - - The color selector now uses the color's edge color for the borders instead of black. diff -r 23130cafe95e -r b0d84fb70ea5 src/actionsEdit.cc --- 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; } diff -r 23130cafe95e -r b0d84fb70ea5 src/configDialog.cc --- a/src/configDialog.cc Wed May 21 19:00:57 2014 +0300 +++ b/src/configDialog.cc Thu May 22 18:01:19 2014 +0300 @@ -77,6 +77,8 @@ EXTERN_CFGENTRY (Float, gridFineCoordinateSnap); EXTERN_CFGENTRY (Float, gridFineAngleSnap); EXTERN_CFGENTRY (Bool, highlightObjectBelowCursor) +EXTERN_CFGENTRY (Int, roundPosition) +EXTERN_CFGENTRY (Int, roundMatrix) const char* g_extProgPathFilter = #ifdef _WIN32 @@ -117,6 +119,9 @@ ui->m_logostuds->setChecked (cfg::useLogoStuds); ui->linelengths->setChecked (cfg::drawLineLengths); + ui->roundPosition->setValue (cfg::roundPosition); + ui->roundMatrix->setValue (cfg::roundMatrix); + int i = 0; for (QAction* act : g_win->findChildren()) @@ -300,6 +305,8 @@ cfg::defaultLicense = ui->m_profileLicense->currentIndex(); cfg::antiAliasedLines = ui->m_aa->isChecked(); cfg::highlightObjectBelowCursor = ui->highlightObjectBelowCursor->isChecked(); + cfg::roundPosition = ui->roundPosition->value(); + cfg::roundMatrix = ui->roundMatrix->value(); // Rebuild the quick color toolbar g_win->setQuickColors (quickColors); diff -r 23130cafe95e -r b0d84fb70ea5 src/configDialog.h --- a/src/configDialog.h Wed May 21 19:00:57 2014 +0300 +++ b/src/configDialog.h Thu May 22 18:01:19 2014 +0300 @@ -44,6 +44,7 @@ enum Tab { InterfaceTab, + EditingToolsTab, ProfileTab, ShortcutsTab, QuickColorsTab, diff -r 23130cafe95e -r b0d84fb70ea5 ui/config.ui --- a/ui/config.ui Wed May 21 19:00:57 2014 +0300 +++ b/ui/config.ui Thu May 22 18:01:19 2014 +0300 @@ -7,7 +7,7 @@ 0 0 717 - 407 + 419 @@ -41,6 +41,11 @@ + Editing tools + + + + Profile @@ -74,7 +79,7 @@ - 0 + 1 @@ -317,6 +322,65 @@ + + + + + + Editing tools + + + + + + Rounding + + + + + + + + Position decimals: + + + + + + + + + + Matrix decimals: + + + + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + +