Fixed incremental rotations when dragging in the properties widget.

This commit is contained in:
Leonardo Zide
2026-03-05 16:44:46 -08:00
parent a8ccd4b5aa
commit d80b38a41b
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -327,12 +327,12 @@ void lcPropertiesWidget::ChangeFloatValue(lcObjectPropertyId PropertyId, float V
{
lcVector3 InitialRotation(0.0f, 0.0f, 0.0f);
if (Piece)
if (mLastRotation)
InitialRotation = mLastRotation.value();
else if (Piece)
InitialRotation = lcMatrix44ToEulerAngles(Piece->mModelWorld) * LC_RTOD;
else if (Light)
InitialRotation = lcMatrix44ToEulerAngles(Light->GetWorldMatrix()) * LC_RTOD;
else
InitialRotation = mLastRotation;
lcVector3 Rotation = InitialRotation;
@@ -1571,7 +1571,7 @@ void lcPropertiesWidget::Update(const std::vector<lcObject*>& Selection, lcObjec
if (mDisableUpdates)
return;
mLastRotation = lcVector3(0.0f, 0.0f, 0.0f);
mLastRotation.reset();
mFocusObject = nullptr;
mSelection.clear();
+1 -1
View File
@@ -132,7 +132,7 @@ protected:
std::vector<lcObject*> mSelection;
lcObject* mFocusObject = nullptr;
bool mDisableUpdates = false;
lcVector3 mLastRotation = lcVector3(0.0f, 0.0f, 0.0f);
std::optional<lcVector3> mLastRotation;
std::array<PropertyWidgets, static_cast<int>(lcObjectPropertyId::Count)> mPropertyWidgets = {};
std::array<CategoryWidgets, static_cast<int>(CategoryIndex::Count)> mCategoryWidgets = {};