// If we moved out of the old block then unstyle it
if (_previouslyHovered != null) {
needRepaint = true;
_previouslyHovered.restyle(c);
PaintingInfo paintInfo = _previouslyHovered.getPaintingInfo();
if (paintInfo == null) {
targetedRepaint = false;
} else {
repaintRegion = new Rectangle(paintInfo.getAggregateBounds());
}
_previouslyHovered = null;
}
if (currentlyHovered != null) {
needRepaint = true;
Box target = box.getRestyleTarget();
target.restyle(c);
if (targetedRepaint) {
PaintingInfo paintInfo = target.getPaintingInfo();
if (paintInfo == null) {
targetedRepaint = false;
} else {
if (repaintRegion == null) {
repaintRegion = new Rectangle(paintInfo.getAggregateBounds());
} else {
repaintRegion.add(paintInfo.getAggregateBounds());
}
}
}
_previouslyHovered = target;