Minor UX improvement when mixing group rotation does not have the

expected effect
This commit is contained in:
brunoherbelin
2021-03-17 22:03:19 +01:00
parent cd4d8f02cb
commit 05cb1db020

View File

@@ -181,6 +181,7 @@ void MixingGroup::update (float)
angle -= glm::orientedAngle( glm::normalize(pos_second), glm::vec2(1.f, 0.f) ); angle -= glm::orientedAngle( glm::normalize(pos_second), glm::vec2(1.f, 0.f) );
dist /= glm::length( pos_second ); dist /= glm::length( pos_second );
int numactions = 0;
auto it = sources_.begin(); auto it = sources_.begin();
for (; it != sources_.end(); it++){ for (; it != sources_.end(); it++){
@@ -193,6 +194,7 @@ void MixingGroup::update (float)
(*it)->group(View::MIXING)->translation_.x = vec.x; (*it)->group(View::MIXING)->translation_.x = vec.x;
(*it)->group(View::MIXING)->translation_.y = vec.y; (*it)->group(View::MIXING)->translation_.y = vec.y;
(*it)->touch(); (*it)->touch();
numactions++;
} }
// update point // update point
@@ -200,6 +202,9 @@ void MixingGroup::update (float)
} }
// update path // update path
lines_->changePath(p); lines_->changePath(p);
// no source was rotated? better action is thus to grab
if (numactions<1)
update_action_ = ACTION_GRAB_ALL;
} }
// done // done