diff --git a/common/lc_propertieswidget.cpp b/common/lc_propertieswidget.cpp index b8917ee2..9a9596a5 100644 --- a/common/lc_propertieswidget.cpp +++ b/common/lc_propertieswidget.cpp @@ -330,6 +330,8 @@ void lcPropertiesWidget::ChangeFloatValue(lcObjectPropertyId PropertyId, float V InitialRotation = lcMatrix44ToEulerAngles(Piece->mModelWorld) * LC_RTOD; else if (Light) InitialRotation = lcMatrix44ToEulerAngles(Light->GetWorldMatrix()) * LC_RTOD; + else + InitialRotation = mLastRotation; lcVector3 Rotation = InitialRotation; @@ -341,6 +343,8 @@ void lcPropertiesWidget::ChangeFloatValue(lcObjectPropertyId PropertyId, float V Rotation[2] = Value; Model->RotateSelectedObjects(Rotation - InitialRotation, true, false, !Dragging); + + mLastRotation = Rotation; } else if (Piece || Light) { @@ -1566,6 +1570,7 @@ void lcPropertiesWidget::Update(const std::vector& Selection, lcObjec if (mDisableUpdates) return; + mLastRotation = lcVector3(0.0f, 0.0f, 0.0f); mFocusObject = nullptr; mSelection.clear(); diff --git a/common/lc_propertieswidget.h b/common/lc_propertieswidget.h index 6430b7ff..46776518 100644 --- a/common/lc_propertieswidget.h +++ b/common/lc_propertieswidget.h @@ -1,6 +1,7 @@ #pragma once #include "lc_objectproperty.h" +#include "lc_math.h" class lcCollapsibleWidgetButton; class lcKeyFrameWidget; @@ -131,6 +132,7 @@ protected: std::vector mSelection; lcObject* mFocusObject = nullptr; bool mDisableUpdates = false; + lcVector3 mLastRotation = lcVector3(0.0f, 0.0f, 0.0f); std::array(lcObjectPropertyId::Count)> mPropertyWidgets = {}; std::array(CategoryIndex::Count)> mCategoryWidgets = {};