From ac9cfa2fab14627ee47d4c9e20ad601e683a4d62 Mon Sep 17 00:00:00 2001 From: Marlin Frickenschmidt Date: Mon, 24 Jan 2011 15:43:52 +0000 Subject: [PATCH] MovePlugin will no longer try to transform the selection in MoveSelection mode when the mouse moved without any button pressed. Backups of the selection will only be created when something actually changed (transformation matrix != identity matrix). git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10730 383ad7c9-94d9-4d36-a494-682f7c89f535 --- MovePlugin.cc | 5 +++-- MovePluginScript.cc | 25 +++++++++++++++---------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/MovePlugin.cc b/MovePlugin.cc index 40f6e5f..2e87080 100644 --- a/MovePlugin.cc +++ b/MovePlugin.cc @@ -589,11 +589,12 @@ void MovePlugin::manipulatorMoved( QtTranslationManipulatorNode* _node , QMouseE if ( PluginFunctions::pickMode() != "Move" && PluginFunctions::pickMode() != "MoveSelection" ) return; - + OpenFlipper::Options::redrawDisabled( true ); // Apply changes only on Release for moveMode and after every movement in MoveSelection Mode - if ( ((_event->type() == QEvent::MouseButtonRelease) || (PluginFunctions::pickMode() != "Move")) && !placeMode_) { + if ( !placeMode_ && ((_event->type() == QEvent::MouseButtonRelease) || + (PluginFunctions::pickMode() != "Move" && _event->buttons() != Qt::NoButton)) ) { int objectId = _node->getIdentifier(); diff --git a/MovePluginScript.cc b/MovePluginScript.cc index 43814df..0f5ef7e 100644 --- a/MovePluginScript.cc +++ b/MovePluginScript.cc @@ -396,8 +396,9 @@ void MovePlugin::transform( int _objectId , Matrix4x4 _matrix ){ emit scriptInfo( "transform( ObjectId , Matrix4x4(" + matString + " ) )" ); - // Create backup - emit createBackup(_objectId, "Transformation"); + // Create backup if there was a change + if (!_matrix.is_identity()) + emit createBackup(_objectId, "Transformation"); } @@ -486,8 +487,9 @@ void MovePlugin::transform( int _objectId , IdList _vHandles, Matrix4x4 _matrix emit scriptInfo( "transform( ObjectId , Matrix4x4(" + matString + " ) )" ); - // Create backup - emit createBackup(_objectId, "Transformation"); + // Create backup if there was a change + if (!_matrix.is_identity()) + emit createBackup(_objectId, "Transformation"); } @@ -572,8 +574,9 @@ void MovePlugin::transformVertexSelection( int _objectId , Matrix4x4 _matrix ){ emit scriptInfo( "transformVertexSelection( ObjectId , Matrix4x4(" + matString + " ) )" ); - // Create backup - emit createBackup(_objectId, "Transformation of Vertex Selection"); + // Create backup if there was a change + if (!_matrix.is_identity()) + emit createBackup(_objectId, "Transformation of Vertex Selection"); } @@ -679,8 +682,9 @@ void MovePlugin::transformFaceSelection( int _objectId , Matrix4x4 _matrix ){ emit scriptInfo( "transformFaceSelection( ObjectId , Matrix4x4(" + matString + " ) )" ); - // Create backup - emit createBackup(_objectId, "Transformation of Face Selection"); + // Create backup if there was a change + if (!_matrix.is_identity()) + emit createBackup(_objectId, "Transformation of Face Selection"); } @@ -802,8 +806,9 @@ void MovePlugin::transformEdgeSelection( int _objectId , Matrix4x4 _matrix ){ emit scriptInfo( "transformEdgeSelection( ObjectId , Matrix4x4(" + matString + " ) )" ); - // Create backup - emit createBackup(_objectId, "Transformation of Edge Selection"); + // Create backup if there was a change + if (!_matrix.is_identity()) + emit createBackup(_objectId, "Transformation of Edge Selection"); } //------------------------------------------------------------------------------ -- GitLab