Navigation Menu

Skip to content

Commit

Permalink
Sketcher Ellipse bug fix: Jump back on mouseup when shrinked
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepSOIC authored and wwmayer committed Dec 20, 2014
1 parent a458c3e commit e423c30
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/Mod/Sketcher/App/Sketch.cpp
Expand Up @@ -2077,8 +2077,13 @@ bool Sketch::updateGeometry()
double phi = atan2(fd.y,fd.x);

aoe->setCenter(center);
aoe->setMajorRadius(radmaj);
aoe->setMinorRadius(radmin);
if ( radmaj >= aoe->getMinorRadius() ){//ensure that ellipse's major radius is always larger than minor raduis... may still cause problems with degenerates.
aoe->setMajorRadius(radmaj);
aoe->setMinorRadius(radmin);
} else {
aoe->setMinorRadius(radmin);
aoe->setMajorRadius(radmaj);
}
aoe->setAngleXU(phi);
aoe->setRange(*myArc.startAngle, *myArc.endAngle);
} else if (it->type == Circle) {
Expand All @@ -2102,8 +2107,13 @@ bool Sketch::updateGeometry()
double phi = atan2(fd.y,fd.x);

ellipse->setCenter(center);
ellipse->setMajorRadius(radmaj);
ellipse->setMinorRadius(radmin);
if ( radmaj >= ellipse->getMinorRadius() ){//ensure that ellipse's major radius is always larger than minor raduis... may still cause problems with degenerates.
ellipse->setMajorRadius(radmaj);
ellipse->setMinorRadius(radmin);
} else {
ellipse->setMinorRadius(radmin);
ellipse->setMajorRadius(radmaj);
}
ellipse->setAngleXU(phi);
}
} catch (Base::Exception e) {
Expand Down

0 comments on commit e423c30

Please sign in to comment.