# HG changeset patch # User Santeri Piippo # Date 1389360509 -7200 # Node ID aac6f002107098b9e24220f191d34653b5c6e466 # Parent 2d01590da2863f296adfe3f556212233b3686563 - improved rotation point finding behavior. not sure what did I even do to improve it... diff -r 2d01590da286 -r aac6f0021070 ldforge.pro --- a/ldforge.pro Fri Jan 10 11:09:38 2014 +0200 +++ b/ldforge.pro Fri Jan 10 15:28:29 2014 +0200 @@ -25,8 +25,8 @@ } exists(.git): DEFINES += GIT_DESCRIBE="\"\\\"$$system(git describe --tags --long)\\\"\"" -DEFINES += COMPILE_DATE="\"\\\"$$system(LC_ALL=C date \"+%d %h %Y %H:%M:%S\")\\\"\"" unix { LIBS += -lGLU + DEFINES += COMPILE_DATE="\"\\\"$$system(LC_ALL=C date \"+%d %h %Y %H:%M:%S\")\\\"\"" } diff -r 2d01590da286 -r aac6f0021070 src/gui.cc --- a/src/gui.cc Fri Jan 10 11:09:38 2014 +0200 +++ b/src/gui.cc Fri Jan 10 15:28:29 2014 +0200 @@ -285,7 +285,9 @@ title += " [pre-release build]"; #endif // DEBUG +#ifdef COMPILE_DATE title += " (built " COMPILE_DATE ")"; +#endif // COMPILE_DATE setWindowTitle (title); } diff -r 2d01590da286 -r aac6f0021070 src/gui_editactions.cc --- a/src/gui_editactions.cc Fri Jan 10 11:09:38 2014 +0200 +++ b/src/gui_editactions.cc Fri Jan 10 15:28:29 2014 +0200 @@ -471,6 +471,8 @@ cosangle = cos (angle), sinangle = sin (angle); + log ("rotpoint: %1", rotpoint); + // ref: http://en.wikipedia.org/wiki/Transformation_matrix#Rotation_2 Matrix transform ( { diff -r 2d01590da286 -r aac6f0021070 src/main.h --- a/src/main.h Fri Jan 10 11:09:38 2014 +0200 +++ b/src/main.h Fri Jan 10 15:28:29 2014 +0200 @@ -44,11 +44,6 @@ #define BUILD_RELEASE 1 // ============================================= -#ifndef COMPILE_DATE -# error COMPILE_DATE is not set (qmake should have done this) -#endif // COMPILE_DATE - -// ============================================= #ifdef DEBUG # undef RELEASE #endif // DEBUG diff -r 2d01590da286 -r aac6f0021070 src/misc.cc --- a/src/misc.cc Fri Jan 10 11:09:38 2014 +0200 +++ b/src/misc.cc Fri Jan 10 15:28:29 2014 +0200 @@ -211,18 +211,20 @@ // ----------------------------------------------------------------------------- Vertex rotPoint (const QList& objs) { - LDBoundingBox box; - switch (edit_rotpoint) { case ObjectOrigin: { + LDBoundingBox box; + // Calculate center vertex for (LDObject* obj : objs) + { if (obj->hasMatrix()) box << dynamic_cast (obj)->getPosition(); else box << obj; + } return box.center(); } diff -r 2d01590da286 -r aac6f0021070 src/types.cc --- a/src/types.cc Fri Jan 10 11:09:38 2014 +0200 +++ b/src/types.cc Fri Jan 10 15:28:29 2014 +0200 @@ -388,11 +388,8 @@ { for_axes (ax) { - if (v[ax] < m_Vertex0[ax]) - m_Vertex0[ax] = v[ax]; - - if (v[ax] > m_Vertex1[ax]) - m_Vertex1[ax] = v[ax]; + m_Vertex0[ax] = min (v[ax], m_Vertex0[ax]); + m_Vertex1[ax] = max (v[ax], m_Vertex1[ax]); } setEmpty (false); @@ -402,9 +399,8 @@ // ----------------------------------------------------------------------------- void LDBoundingBox::reset() { - m_Vertex0[X] = m_Vertex0[Y] = m_Vertex0[Z] = 0x7FFFFFFF; - m_Vertex1[X] = m_Vertex1[Y] = m_Vertex1[Z] = 0xFFFFFFFF; - + m_Vertex0[X] = m_Vertex0[Y] = m_Vertex0[Z] = 10000.0; + m_Vertex1[X] = m_Vertex1[Y] = m_Vertex1[Z] = -10000.0; setEmpty (true); }