Skip to content

Commit

Permalink
Merge pull request #571 from Rupicapra-rupicapra/master
Browse files Browse the repository at this point in the history
Helper, shortcut & bug correction for "Circle with center & radius" tool
  • Loading branch information
dxli committed Sep 16, 2015
2 parents 2ab2441 + c1d9c3b commit ef90c06
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
11 changes: 9 additions & 2 deletions librecad/src/actions/rs_actiondrawcirclecr.cpp
Expand Up @@ -73,7 +73,15 @@ void RS_ActionDrawCircleCR::trigger() {
*data);
circle->setLayerToActive();
circle->setPenToActive();
container->addEntity(circle);

switch(getStatus()) {
case SetCenter:
container->addEntity(circle);
graphicView->moveRelativeZero(circle->getCenter());
break;
case SetRadius:
break;
}

// upd. undo list:
if (document) {
Expand All @@ -82,7 +90,6 @@ void RS_ActionDrawCircleCR::trigger() {
document->endUndoCycle();
}
graphicView->redraw(RS2::RedrawDrawing);
graphicView->moveRelativeZero(circle->getCenter());

setStatus(SetCenter);

Expand Down
6 changes: 6 additions & 0 deletions librecad/src/cmd/rs_commands.cpp
Expand Up @@ -202,6 +202,12 @@ RS_Commands::RS_Commands() {
{{"c3", QObject::tr("c3", "circle 3 points")}},
RS2::ActionDrawCircle3P
},
//draw circle with point and radius
{
{{"circlecr", QObject::tr("circlecr", "circle with center and radius")}},
{{"cc", QObject::tr("cc", "circle with center and radius")}},
RS2::ActionDrawCircleCR
},
//draw circle tangent to 3 objects
{
{{"tan3", QObject::tr("tan3", "circle tangent to 3")}},
Expand Down

0 comments on commit ef90c06

Please sign in to comment.