_cursorY =
MathUtilities.clamp(0, _cursorY + translateY, _displayHeight);
_cursorPosition.setTrait("#text", "" + _cursorX + ',' + _cursorY);
// If a shape is selected then update the display.
final SVGLocatableElement selected = findFirstSelectedShape();
if (selected != null) {
// Get the bounding box of selected object
final SVGRect rect = selected.getBBox();
// Update the display for the selected shape.
updateDisplay(true, selected.getTrait("id"), rect);
// Updated the bounding box for the selected shape.
updateBounds(true, rect);
} else {
updateDisplay(false, null, null);