mirror of
https://github.com/leozide/leocad.git
synced 2026-07-27 19:56:49 +00:00
Fixed rotating in the properties widget without a focus object.
This commit is contained in:
@@ -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<lcObject*>& Selection, lcObjec
|
||||
if (mDisableUpdates)
|
||||
return;
|
||||
|
||||
mLastRotation = lcVector3(0.0f, 0.0f, 0.0f);
|
||||
mFocusObject = nullptr;
|
||||
mSelection.clear();
|
||||
|
||||
|
||||
@@ -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<lcObject*> mSelection;
|
||||
lcObject* mFocusObject = nullptr;
|
||||
bool mDisableUpdates = false;
|
||||
lcVector3 mLastRotation = lcVector3(0.0f, 0.0f, 0.0f);
|
||||
|
||||
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