From 627e4e5fc2e189846e59f0b1d44182b319afba3b Mon Sep 17 00:00:00 2001 From: David Jee Date: Wed, 7 Jan 2004 21:20:01 +0000 Subject: [PATCH] 2004-01-07 David Jee * java/awt/Container.java (update): Clear only the clipped region, instead of clearing the entire Container. (visitChildren): Visit children in descending order. From-SVN: r75517 --- libjava/ChangeLog | 7 +++++++ libjava/java/awt/Container.java | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index c9bf7d16309..c97530e33a6 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,10 @@ +2004-01-07 David Jee + + * java/awt/Container.java + (update): Clear only the clipped region, instead of clearing the + entire Container. + (visitChildren): Visit children in descending order. + 2004-01-07 Michael Koch * java/lang/reflect/Array.java: Merged documentation with classpath. diff --git a/libjava/java/awt/Container.java b/libjava/java/awt/Container.java index ad43ce41a92..763cfbb9b30 100644 --- a/libjava/java/awt/Container.java +++ b/libjava/java/awt/Container.java @@ -677,7 +677,11 @@ public class Container extends Component */ public void update(Graphics g) { - g.clearRect(0, 0, width, height); + Rectangle clip = g.getClipBounds(); + if (clip == null) + g.clearRect(0, 0, width, height); + else + g.clearRect(clip.x, clip.y, clip.width, clip.height); super.update(g); } @@ -1196,7 +1200,7 @@ public class Container extends Component { synchronized (getTreeLock ()) { - for (int i = 0; i < ncomponents; ++i) + for (int i = ncomponents - 1; i >= 0; --i) { Component comp = component[i]; boolean applicable = comp.isVisible() -- 2.30.2