javauis/lcdui_qt/src/javax/microedition/lcdui/CustomItem.java
changeset 47 f40128debb5d
parent 35 85266cc22c7f
child 61 bf7ee68962da
--- a/javauis/lcdui_qt/src/javax/microedition/lcdui/CustomItem.java	Fri Jun 11 13:33:44 2010 +0300
+++ b/javauis/lcdui_qt/src/javax/microedition/lcdui/CustomItem.java	Wed Jun 23 18:07:10 2010 +0300
@@ -68,7 +68,7 @@
 
     // Graphics command buffer for this instance
     Buffer graphicsBuffer;
-    Graphics CustomItemGraphics;
+    Graphics customItemGraphics;
 
     CustomItemLayouter layouter;
 
@@ -550,11 +550,11 @@
                     widgetDisposed = true;
                     return;
                 }
-                if(CustomItemGraphics == null)
+                if(customItemGraphics == null)
                 {
                     graphicsBuffer = Buffer.createInstance(self, (Control)event.widget);
-                    CustomItemGraphics = graphicsBuffer.getGraphics();
-                    CustomItemGraphics.setSyncStrategy(Graphics.SYNC_LEAVE_SURFACE_SESSION_OPEN);
+                    customItemGraphics = graphicsBuffer.getGraphics();
+                    customItemGraphics.setSyncStrategy(Graphics.SYNC_LEAVE_SURFACE_SESSION_OPEN);
                 }
                 else
                 {
@@ -583,17 +583,18 @@
                     contentHeight = this.contentHeight;
                 }
 
-                CustomItemGraphics.setClip(0, 0, contentWidth, contentHeight);
-                CustomItemGraphics.cleanBackground(new Rectangle(0, 0, contentWidth, contentHeight));
+                customItemGraphics.setClip(0, 0, contentWidth, contentHeight);
+                customItemGraphics.cleanBackground(new Rectangle(0, 0, contentWidth, contentHeight));
                 cleanupNeeded = false;
             }
         }
 
         // Clip must define the invalid area
-        CustomItemGraphics.setClip(redrawNowX, redrawNowY, redrawNowW, redrawNowH);
+        customItemGraphics.reset();
+        customItemGraphics.setClip(redrawNowX, redrawNowY, redrawNowW, redrawNowH);
 
         // The callback
-        paint(CustomItemGraphics, contentWidth, contentHeight);
+        paint(customItemGraphics, contentWidth, contentHeight);
 
         // Wait until the UI thread is available. Then in the UI thread
         // synchronously send a paint event.