From 1935820884927f93402b6fcd417af2284b49e0f6 Mon Sep 17 00:00:00 2001 From: Hombre Date: Sat, 14 Sep 2019 23:03:19 +0200 Subject: [PATCH] Fix crash in Spot Removal tool when deleting a Spot entry --- rtgui/spot.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/rtgui/spot.cc b/rtgui/spot.cc index 5fb1de8c9..31f5a138e 100644 --- a/rtgui/spot.cc +++ b/rtgui/spot.cc @@ -460,12 +460,11 @@ CursorShape Spot::getCursor (int objectID, int xPos, int yPos) const return CSEmpty; } - int object = editProvider->getObject(); - if (object == 0 || object == 1) { + if (objectID == 0 || objectID == 1) { return CSMove2D; } - if (object >= 2 || object <= 5) { - Coord delta(Coord(xPos, yPos) - ((object == 3 || object == 5) ? spots.at(activeSpot).sourcePos : spots.at(activeSpot).targetPos)); + if (objectID >= 2 && objectID <= 5) { + Coord delta(Coord(xPos, yPos) - ((objectID == 3 || objectID == 5) ? spots.at(activeSpot).sourcePos : spots.at(activeSpot).targetPos)); PolarCoord polarPos(delta); if (polarPos.angle < 0.) { polarPos.angle += 180.;