Commit 884064bb authored by Hans-Christian Ebke's avatar Hans-Christian Ebke

Little bugfix and Shift-Modification of circular and bezier poly lines. (By Hannes.)


git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17445 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 025b405d
......@@ -1213,11 +1213,15 @@ me_move( QMouseEvent* _event )
if(!moveCircle_SelNode_->name().compare("N_Handle0")) {
ACG::Vec3d axisb = (axisa % n).normalize();
lineData->circleMainRadius_ = cr;
if(_event->modifiers() & Qt::ShiftModifier)
lineData->circleSideRadius_ = cr;
lineData->circleMainAxis_ = axisa;
lineData->circleSideAxis_ = axisb;
} else {
ACG::Vec3d axisb = (n % axisa).normalize();
lineData->circleSideRadius_ = cr;
if(_event->modifiers() & Qt::ShiftModifier)
lineData->circleMainRadius_ = cr;
lineData->circleSideAxis_ = axisa;
lineData->circleMainAxis_ = axisb;
}
......@@ -1248,13 +1252,17 @@ me_move( QMouseEvent* _event )
ACG::Vec3d onPlane = cameraPos + t * cameraDir;
lineData->Handles_[handleIndex] = onPlane;
if(handleIndex % 2 == 1 && handleIndex != (int)lineData->Handles_.size()) {
if(handleIndex % 2 == 1 && handleIndex != ((int)lineData->Handles_.size() - 1)) {
double dist = (lineData->Handles_[handleIndex + 1] - control.Pos_).norm();
if(_event->modifiers() & Qt::ShiftModifier)
dist = (onPlane - control.Pos_).norm();
ACG::Vec3d dir = -(onPlane - control.Pos_).normalize();
lineData->Handles_[handleIndex + 1] = control.Pos_ + dir * dist;
}
if(handleIndex % 2 == 0 && handleIndex) {
double dist = (lineData->Handles_[handleIndex - 1] - control.Pos_).norm();
if(_event->modifiers() & Qt::ShiftModifier)
dist = (onPlane - control.Pos_).norm();
ACG::Vec3d dir = -(onPlane - control.Pos_).normalize();
lineData->Handles_[handleIndex - 1] = control.Pos_ + dir * dist;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment