From 54a98ed5e80ca006533593f851ad44858ae9131e Mon Sep 17 00:00:00 2001 From: Garux Date: Wed, 21 Mar 2018 03:03:41 +0300 Subject: [PATCH] * fix RadiantSelectionSystem::getSelectionAABB() for PlaneSelectables --- plugins/entity/light.cpp | 8 +------- radiant/selection.cpp | 2 ++ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/plugins/entity/light.cpp b/plugins/entity/light.cpp index f5bdd5ca..41ffdb27 100644 --- a/plugins/entity/light.cpp +++ b/plugins/entity/light.cpp @@ -1771,8 +1771,7 @@ class LightInstance : public SelectionTestable, public RendererLight, public PlaneSelectable, - public ComponentSelectionTestable, - public ComponentEditable + public ComponentSelectionTestable { class TypeCasts { @@ -1787,7 +1786,6 @@ TypeCasts(){ InstanceStaticCast::install( m_casts ); InstanceStaticCast::install( m_casts ); InstanceStaticCast::install( m_casts ); - InstanceStaticCast::install( m_casts ); InstanceIdentityCast::install( m_casts ); } InstanceTypeCastTable& get(){ @@ -1878,10 +1876,6 @@ void setSelectedComponents( bool select, SelectionSystem::EComponentMode mode ){ void testSelectComponents( Selector& selector, SelectionTest& test, SelectionSystem::EComponentMode mode ){ } -const AABB& getSelectedComponentsBounds() const { - return m_contained.aabb(); -} - void selectedChangedComponent( const Selectable& selectable ){ GlobalSelectionSystem().getObserver ( SelectionSystem::eComponent )( selectable ); GlobalSelectionSystem().onComponentSelection( *this, selectable ); diff --git a/radiant/selection.cpp b/radiant/selection.cpp index a8b41389..6bcbd83f 100644 --- a/radiant/selection.cpp +++ b/radiant/selection.cpp @@ -4899,6 +4899,8 @@ AABB RadiantSelectionSystem::getSelectionAABB() const { if ( !nothingSelected() ) { if ( Mode() == eComponent || g_bTmpComponentMode ) { Scene_BoundsSelectedComponent( GlobalSceneGraph(), bounds ); + if( !aabb_valid( bounds ) ) /* selecting PlaneSelectables sets g_bTmpComponentMode, but only brushes return correct componentEditable->getSelectedComponentsBounds() */ + Scene_BoundsSelected( GlobalSceneGraph(), bounds ); } else {