Leave spot removal widgets in good state on commit

Set the correct geometry states if edit mode is toggled off while a spot
is being dragged.
This commit is contained in:
Lawrence Lee
2021-05-22 17:35:22 -07:00
parent 36f1300a6b
commit 76706ac276
2 changed files with 21 additions and 0 deletions

View File

@@ -185,6 +185,25 @@ void Spot::resetPressed()
}
}
/**
* Release anything that's currently being dragged.
*/
void Spot::releaseEdit()
{
Geometry *loGeom = getVisibleGeometryFromMO (lastObject);
if (!loGeom) {
EditSubscriber::action = EditSubscriber::Action::NONE;
return;
}
loGeom->state = Geometry::ACTIVE;
sourceIcon.state = Geometry::ACTIVE;
EditSubscriber::action = EditSubscriber::Action::NONE;
draggedSide = DraggedSide::NONE;
updateGeometry();
}
void Spot::setBatchMode (bool batchMode)
{
ToolPanel::setBatchMode (batchMode);
@@ -237,6 +256,7 @@ void Spot::editToggled ()
listener->refreshPreview(EvSpotEnabledOPA); // reprocess the preview w/o creating History entry
subscribe();
} else {
releaseEdit();
unsubscribe();
listener->unsetTweakOperator(this);
listener->refreshPreview(EvSpotEnabled); // reprocess the preview w/o creating History entry

View File

@@ -82,6 +82,7 @@ private:
void addNewEntry ();
void deleteSelectedEntry ();
void resetPressed ();
void releaseEdit();
protected:
Gtk::Box* labelBox;