From 684ab789609667c990c6142c03b8e7978043e6bb Mon Sep 17 00:00:00 2001 From: Rupicapra-rupicapra Date: Wed, 16 Sep 2015 16:14:13 +0200 Subject: [PATCH 1/2] Added help tip, shortcut command & corrected bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Help tip : when in mode "circle with center and radius", typing "radius" in the command-line allow the user to set the radius without moving hands off the keyboard, but the helper message didn't mentionned that possibility. Bug : when setting radius from commandline, pressing enter to validate causes LibreCAD to draw a circle of selected radius at relative zero position (if no mouse activity into the container) or crosshair position (if mouse activity into the container). I added a `switch` test to the `trigger()` method to test the mode, and if the user is in mode "SetRadius", circle is not drawn & relative zero is not moved. Command shortcuts: `circlecr` and `cc` Conflicts: librecad/src/cmd/rs_commands.cpp --- librecad/src/actions/rs_actiondrawcirclecr.cpp | 11 +++++++++-- librecad/src/cmd/rs_commands.cpp | 9 +++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/librecad/src/actions/rs_actiondrawcirclecr.cpp b/librecad/src/actions/rs_actiondrawcirclecr.cpp index 79b9b1c7f6..1248006a64 100644 --- a/librecad/src/actions/rs_actiondrawcirclecr.cpp +++ b/librecad/src/actions/rs_actiondrawcirclecr.cpp @@ -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) { @@ -82,7 +90,6 @@ void RS_ActionDrawCircleCR::trigger() { document->endUndoCycle(); } graphicView->redraw(RS2::RedrawDrawing); - graphicView->moveRelativeZero(circle->getCenter()); setStatus(SetCenter); diff --git a/librecad/src/cmd/rs_commands.cpp b/librecad/src/cmd/rs_commands.cpp index ed0c4c0f46..9137745906 100644 --- a/librecad/src/cmd/rs_commands.cpp +++ b/librecad/src/cmd/rs_commands.cpp @@ -202,6 +202,15 @@ RS_Commands::RS_Commands() { {{"c3", QObject::tr("c3", "circle 3 points")}}, RS2::ActionDrawCircle3P }, +<<<<<<< HEAD +======= + //draw circle with point and radius + { + {{"circlecr", QObject::tr("circlepr", "circle with center and radius")}}, + {{"cc", QObject::tr("cc", "circle with center and radius")}}, + RS2::ActionDrawCircleCR + }, +>>>>>>> 20d9ab4... Added help tip, shortcut command & corrected bug //draw circle tangent to 3 objects { {{"tan3", QObject::tr("tan3", "circle tangent to 3")}}, From c1d9c3b0c7d929b812c935ffc23efe94a2537fbd Mon Sep 17 00:00:00 2001 From: Jerry Date: Wed, 16 Sep 2015 16:18:19 +0200 Subject: [PATCH 2/2] Fixed conflict in rs_commands.cpp --- librecad/src/cmd/rs_commands.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/librecad/src/cmd/rs_commands.cpp b/librecad/src/cmd/rs_commands.cpp index 9137745906..c91414de21 100644 --- a/librecad/src/cmd/rs_commands.cpp +++ b/librecad/src/cmd/rs_commands.cpp @@ -202,15 +202,12 @@ RS_Commands::RS_Commands() { {{"c3", QObject::tr("c3", "circle 3 points")}}, RS2::ActionDrawCircle3P }, -<<<<<<< HEAD -======= //draw circle with point and radius { - {{"circlecr", QObject::tr("circlepr", "circle with center and radius")}}, + {{"circlecr", QObject::tr("circlecr", "circle with center and radius")}}, {{"cc", QObject::tr("cc", "circle with center and radius")}}, RS2::ActionDrawCircleCR }, ->>>>>>> 20d9ab4... Added help tip, shortcut command & corrected bug //draw circle tangent to 3 objects { {{"tan3", QObject::tr("tan3", "circle tangent to 3")}},