Area area = new Area(clip);
Insets insets = getInsets();
area.intersect(new Area(new Rectangle(insets.left, insets.top, width - insets.left - insets.right, height - insets.top - insets.bottom)));
if (verticalRepeat && horizontalRepeat) {
area.intersect(new Area(new Rectangle(0, 0, width, height)));
g.setClip(area);
} else if (verticalRepeat) {
area.intersect(new Area(new Rectangle(rect.x, 0, rect.width, height)));
g.setClip(area);
} else {