summaryrefslogtreecommitdiff
path: root/javax/swing
diff options
context:
space:
mode:
authorRoman Kennke <roman@kennke.org>2006-04-18 09:18:39 +0000
committerRoman Kennke <roman@kennke.org>2006-04-18 09:18:39 +0000
commit8272480e5ada38550190866a0320cae9ce9fc064 (patch)
tree5549cb691c6fff0c3f5421fcd877ce822caa7828 /javax/swing
parenta114f9b3d6ff24c378ad4be64c81da2abf440a63 (diff)
downloadclasspath-8272480e5ada38550190866a0320cae9ce9fc064.tar.gz
2006-04-18 Roman Kennke <kennke@aicas.com>
PR 27185 * javax/swing/JComponent.java (paintChildrenWithOverlap): When one child is not opaque, propagate the dirty rectangles to the next child. (paintChildrenOptimized): Removed unnecessary 'optimization'. This actually didn't work right and probably gained nothing.
Diffstat (limited to 'javax/swing')
-rw-r--r--javax/swing/JComponent.java32
1 files changed, 7 insertions, 25 deletions
diff --git a/javax/swing/JComponent.java b/javax/swing/JComponent.java
index e025fe877..8f5c22405 100644
--- a/javax/swing/JComponent.java
+++ b/javax/swing/JComponent.java
@@ -1936,6 +1936,12 @@ public abstract class JComponent extends Container implements Serializable
newPaintRects.add(rect);
}
}
+ else
+ {
+ // Not opaque, need to reuse the current paint rectangles
+ // for the next component.
+ newPaintRects.add(r);
+ }
}
else
@@ -2024,34 +2030,10 @@ public abstract class JComponent extends Container implements Serializable
g.clipRect(inner.x, inner.y, inner.width, inner.height);
Component[] children = getComponents();
- // Find the bottommost component that needs to be painted. This is the
- // component that - together with the rectangles of the components that
- // are painted above it - covers the whole clip area.
- Rectangle rect = new Rectangle();
- int startIndex = children.length - 1;
- for (int i = 0; i < children.length; i++)
- {
- Rectangle b = children[i].getBounds();
- if (children[i].isOpaque() && children[i].isVisible()
- && g.hitClip(b.x, b.y, b.width, b.height))
- {
- if (rect.isEmpty())
- rect.setBounds(b);
- else
- SwingUtilities.computeUnion(b.x, b.y, b.width, b.height, rect);
-
- if (SwingUtilities.isRectangleContainingRectangle(rect, inner))
- {
- startIndex = i;
- break;
- }
- }
- }
-
// paintingTile becomes true just before we start painting the component's
// children.
paintingTile = true;
- for (int i = startIndex; i >= 0; i--) //children.length; i++)
+ for (int i = children.length - 1; i >= 0; i--) //children.length; i++)
{
// paintingTile must be set to false before we begin to start painting
// the last tile.