Skip to content

Commit 9d1fadd

Browse files
committed
code improvements [skip ci]
1 parent f224a53 commit 9d1fadd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

plugins/SkyCultureMaker/src/ScmDraw.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ void scm::ScmDraw::handleMouseClicks(class QMouseEvent *event)
200200
if (objectMgr.getWasSelected())
201201
{
202202
StelObjectP stelObj = objectMgr.getLastSelectedObject();
203-
Vec3d stelPos = stelObj->getJ2000EquatorialPos(core);
204203
if (stelObj->getType() == "Star" || stelObj->getType() == "Nebula")
205204
{
206205
QString stelObjID = stelObj->getID();
@@ -210,7 +209,7 @@ void scm::ScmDraw::handleMouseClicks(class QMouseEvent *event)
210209
}
211210
else
212211
{
213-
appendDrawPoint(stelPos, stelObjID);
212+
appendDrawPoint(stelObj->getJ2000EquatorialPos(core), stelObjID);
214213
qDebug() << "SkyCultureMaker: Added sky object to "
215214
"constellation with ID "
216215
<< stelObjID;
@@ -230,8 +229,8 @@ void scm::ScmDraw::handleMouseClicks(class QMouseEvent *event)
230229
if (nearest.has_value())
231230
{
232231
point = nearest.value().coordinate;
233-
appendDrawPoint(point, std::nullopt);
234232
}
233+
appendDrawPoint(point, std::nullopt);
235234
}
236235

237236
event->accept();
@@ -283,7 +282,6 @@ bool scm::ScmDraw::handleMouseMoves(int x, int y, Qt::MouseButtons b)
283282
{
284283
StelObjectP stelObj = objectMgr.getLastSelectedObject();
285284
// only keep the selection if a star or nebula was selected
286-
// and it has a valid id
287285
if (stelObj->getType() != "Star" && stelObj->getType() != "Nebula")
288286
{
289287
objectMgr.unSelect();
@@ -296,6 +294,7 @@ bool scm::ScmDraw::handleMouseMoves(int x, int y, Qt::MouseButtons b)
296294
}
297295
}
298296

297+
// draw a floating line in any mode
299298
if (hasFlag(drawState, (Drawing::hasStart | Drawing::hasFloatingEnd)))
300299
{
301300
StelProjectorP prj = core->getProjection(drawFrame);

0 commit comments

Comments
 (0)