Skip to content

Commit dec9ead

Browse files
committed
Fix SnapComponent applied even if disabled
1 parent d37ea59 commit dec9ead

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/engine/Component/Editor/Snap/SnapComponent.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ namespace vg::engine
4747
//--------------------------------------------------------------------------------------
4848
void SnapComponent::snapObjectRecur(IGameObject * _gameObject)
4949
{
50-
if (_gameObject->IsPrefab())
50+
if (isEnabled() && _gameObject->IsPrefab())
5151
{
5252
bool dirty = false;
5353

@@ -125,7 +125,7 @@ namespace vg::engine
125125
//--------------------------------------------------------------------------------------
126126
bool SnapComponent::TryGetSnapTranslate(core::float3 & _translate) const
127127
{
128-
if (m_snapTranslation)
128+
if (isEnabled() && m_snapTranslation)
129129
{
130130
_translate = m_translation;
131131
return true;
@@ -136,7 +136,7 @@ namespace vg::engine
136136
//--------------------------------------------------------------------------------------
137137
bool SnapComponent::TryGetSnapRotate(float & _rotate) const
138138
{
139-
if (m_snapRotation)
139+
if (isEnabled() && m_snapRotation)
140140
{
141141
_rotate = m_rotation;
142142
return true;
@@ -148,7 +148,7 @@ namespace vg::engine
148148
//--------------------------------------------------------------------------------------
149149
bool SnapComponent::TryGetSnapScale(float & _scale) const
150150
{
151-
if (m_snapScale)
151+
if (isEnabled() && m_snapScale)
152152
{
153153
_scale = m_scale;
154154
return true;

0 commit comments

Comments
 (0)