if (oldClip.contains(x, y, width, height) || (width <= 0 || height <= 0)) {
g.setClip(x, y, width, height);
} else if (oldClip.intersects(x, y, width, height)) {
Rectangle currentRect = oldClip.getBounds();
g.setClip(SwingUtilities.computeIntersection(x, y, width, height, (Rectangle)currentRect.clone()));
}
if (alignWithParent) {
Component parent = component.getParent();
xoff = component.getLocation().x;