From c04661c61d49f830684c4de83cdec54a2b58607c Mon Sep 17 00:00:00 2001 From: codereader Date: Sat, 18 Sep 2021 19:46:11 +0200 Subject: [PATCH] #5746: TexTool is listening to manipulator mode changes now --- radiant/textool/TexTool.cpp | 11 +++++++++++ radiant/textool/TexTool.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/radiant/textool/TexTool.cpp b/radiant/textool/TexTool.cpp index 3076d72e05..77ae6a9d17 100644 --- a/radiant/textool/TexTool.cpp +++ b/radiant/textool/TexTool.cpp @@ -134,6 +134,7 @@ void TexTool::_preHide() _redoHandler.disconnect(); _selectionChanged.disconnect(); + _manipulatorChanged.disconnect(); // Clear items to prevent us from running into stale references // when the textool is shown again @@ -148,6 +149,7 @@ void TexTool::_preShow() _selectionChanged.disconnect(); _undoHandler.disconnect(); _redoHandler.disconnect(); + _manipulatorChanged.disconnect(); // Register self to the SelSystem to get notified upon selection changes. _selectionChanged = GlobalSelectionSystem().signal_selectionChanged().connect( @@ -158,6 +160,10 @@ void TexTool::_preShow() _redoHandler = GlobalUndoSystem().signal_postRedo().connect( sigc::mem_fun(this, &TexTool::onUndoRedoOperation)); + _manipulatorChanged = GlobalTextureToolSelectionSystem().signal_activeManipulatorChanged().connect( + sigc::mem_fun(this, &TexTool::onManipulatorModeChanged) + ); + // Trigger an update of the current selection _selectionRescanNeeded = true; queueDraw(); @@ -168,6 +174,11 @@ void TexTool::onUndoRedoOperation() queueDraw(); } +void TexTool::onManipulatorModeChanged(selection::IManipulator::Type type) +{ + queueDraw(); +} + void TexTool::gridUp() { if (_grid*2 <= GRID_MAX && _gridActive) { _grid *= 2; diff --git a/radiant/textool/TexTool.h b/radiant/textool/TexTool.h index ded9500528..b329911af0 100644 --- a/radiant/textool/TexTool.h +++ b/radiant/textool/TexTool.h @@ -89,6 +89,7 @@ class TexTool : sigc::connection _selectionChanged; sigc::connection _undoHandler; sigc::connection _redoHandler; + sigc::connection _manipulatorChanged; private: // This is where the static shared_ptr of the singleton instance is held. @@ -287,6 +288,7 @@ class TexTool : private: void updateProjection(); double getTextureAspectRatio(); + void onManipulatorModeChanged(selection::IManipulator::Type type); TextureToolMouseEvent createMouseEvent(const Vector2& point, const Vector2& delta = Vector2(0, 0));