From 9c482c2a9a3aa0f5ded31b4bbf423d3142f08462 Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Mon, 4 Oct 2021 18:08:34 -0700 Subject: [PATCH] Fix transform controls (#1081) Signed-off-by: Louise Poubel --- .../transform_control/TransformControl.cc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/gui/plugins/transform_control/TransformControl.cc b/src/gui/plugins/transform_control/TransformControl.cc index b05f48c6a1d..54215f83049 100644 --- a/src/gui/plugins/transform_control/TransformControl.cc +++ b/src/gui/plugins/transform_control/TransformControl.cc @@ -385,6 +385,20 @@ bool TransformControl::eventFilter(QObject *_obj, QEvent *_event) this->dataPtr->mouseEvent = _e->Mouse(); this->dataPtr->mouseDirty = true; } + else if (_event->type() == ignition::gui::events::MousePressOnScene::kType) + { + auto event = + static_cast(_event); + this->dataPtr->mouseEvent = event->Mouse(); + this->dataPtr->mouseDirty = true; + } + else if (_event->type() == ignition::gui::events::DragOnScene::kType) + { + auto event = + static_cast(_event); + this->dataPtr->mouseEvent = event->Mouse(); + this->dataPtr->mouseDirty = true; + } else if (_event->type() == ignition::gui::events::KeyPressOnScene::kType) { ignition::gui::events::KeyPressOnScene *_e = @@ -589,7 +603,8 @@ void TransformControlPrivate::HandleTransform() // start the transform process this->transformControl.SetActiveAxis(axis); this->transformControl.Start(); - if (this->transformControl.Node()){ + if (this->transformControl.Node()) + { try { this->transformControl.Node()->SetUserData(