You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by sm...@apache.org on 2012/05/09 12:10:14 UTC

svn commit: r1336052 - /pivot/trunk/wtk/src/org/apache/pivot/wtk/Container.java

Author: smartini
Date: Wed May  9 10:10:14 2012
New Revision: 1336052

URL: http://svn.apache.org/viewvc?rev=1336052&view=rev
Log:
apply clipbounds, as suggested by Piotr

Modified:
    pivot/trunk/wtk/src/org/apache/pivot/wtk/Container.java

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/Container.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/Container.java?rev=1336052&r1=1336051&r2=1336052&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/Container.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/Container.java Wed May  9 10:10:14 2012
@@ -361,16 +361,21 @@ public abstract class Container extends 
         if (!doubleBuffering) {
             paint0(graphics);
         } else {
+            boolean freshImage = false;
             if (doubleBufferImage == null) {
                 GraphicsConfiguration gc = graphics.getDeviceConfiguration();
                 doubleBufferImage = gc.createCompatibleImage(getWidth(), getHeight(),
                         Transparency.OPAQUE);
                 doubleBufferedRepaintRequired = true;
+                freshImage = true;
             }
-            // TODO use clipbounds
+
             Graphics2D bufferedImageGraphics = (Graphics2D)doubleBufferImage.getGraphics();
             try {
                 if (doubleBufferedRepaintRequired) {
+                    if (!freshImage) {
+                        bufferedImageGraphics.setClip(graphics.getClip());
+                    }
                     paint0(bufferedImageGraphics);
                     doubleBufferedRepaintRequired = false;
                 }