// 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);