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/03/15 16:01:31 UTC

svn commit: r1301025 - /pivot/trunk/wtk/src/org/apache/pivot/wtk/effects/DropShadowDecorator.java

Author: smartini
Date: Thu Mar 15 15:01:31 2012
New Revision: 1301025

URL: http://svn.apache.org/viewvc?rev=1301025&view=rev
Log:
change generated image from compatible with transparency to TYPE_INT_ARGB, to avoid the following exception on some platforms:
Exception thrown during paint(): java.lang.ClassCastException: [I cannot be cast to [S
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException:
[I cannot be cast to [S

Modified:
    pivot/trunk/wtk/src/org/apache/pivot/wtk/effects/DropShadowDecorator.java

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/effects/DropShadowDecorator.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/effects/DropShadowDecorator.java?rev=1301025&r1=1301024&r2=1301025&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/effects/DropShadowDecorator.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/effects/DropShadowDecorator.java Thu Mar 15 15:01:31 2012
@@ -177,8 +177,7 @@ public class DropShadowDecorator impleme
                 || shadowImage.getWidth() != width + 2 * blurRadius
                 || shadowImage.getHeight() != height + 2 * blurRadius) {
                 // Recreate the shadow
-                BufferedImage rectangleImage =
-                    graphics.getDeviceConfiguration().createCompatibleImage(width, height, Transparency.OPAQUE);
+                BufferedImage rectangleImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
                 Graphics2D rectangleImageGraphics = rectangleImage.createGraphics();
                 rectangleImageGraphics.setColor(Color.BLACK);
                 rectangleImageGraphics.fillRect(0, 0, width, height);