Fix crash when deleting spot removal spot
Deleting a spot while hovering over one of the circles for adjusting the radius or feathering could trigger a crash. This is because immediately after deleting a geometry object, EditSubscriber::getCursor is given an object ID based on old data, causing the spot tool to attempt to get information about the deleted geometry object. This commit fixes the issue by returning the default cursor if the active spot is -1. It works because the active spot is set to -1 when deleting a spot, and there is no need to use a special cursor when there is no active spot. A better long-term solution would be updating the geometry data before calling EditSubscriber::getCursor.
This commit is contained in:
parent
10b5f65b30
commit
f958074d9b
@ -462,7 +462,7 @@ void Spot::deleteSelectedEntry()
|
|||||||
CursorShape Spot::getCursor (int objectID, int xPos, int yPos) const
|
CursorShape Spot::getCursor (int objectID, int xPos, int yPos) const
|
||||||
{
|
{
|
||||||
const EditDataProvider* editProvider = getEditProvider();
|
const EditDataProvider* editProvider = getEditProvider();
|
||||||
if (editProvider) {
|
if (editProvider && activeSpot > -1) {
|
||||||
if (draggedSide != DraggedSide::NONE) {
|
if (draggedSide != DraggedSide::NONE) {
|
||||||
return CSEmpty;
|
return CSEmpty;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user