mirror of
https://github.com/leozide/leocad.git
synced 2026-07-27 19:56:49 +00:00
Fixed incremental rotations when dragging in the properties widget.
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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 = {};
|
||||
|
||||
Reference in New Issue
Block a user