objectUnderCursor = lastHandle;
}
else
{
// We look for the figure under the cursor
VisualElement figure = (VisualElement) FigureUtil.findInnermostFigure(((ProcessDrawing) drawing()), x, y, VisualElement.class);
if (figure != null)
{
objectUnderCursor = figure;
}
if (figure != lastFigure)
{
// Mouse moved to another figure, update figure hover effect if not entering a child element
if (lastFigure != null && (figure == null || figure.getParentElement() != lastFigure))
{
// Tell the figure it is not hovered by the cursor any more
lastFigure.invalidate();
lastFigure.handleEvent(new VisualElementEvent(VisualElementEvent.CURSOR_LEFT, editor, e, x, y));
}
if (figure != null)
{
// Tell the figure it is hovered by the cursor
figure.handleEvent(new VisualElementEvent(VisualElementEvent.CURSOR_ENTERED, editor, e, x, y));
}
lastFigure = figure;
view.setFigureUnderCursor(figure);
if (figure != null)
{
figure.invalidate();
}
view.repairDamage();
}
}