[libbluray-devel] BDGraphics: fixed default background to be transparent

hpi1 git at videolan.org
Tue Jun 11 15:15:57 CEST 2013


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Tue Jun 11 15:35:27 2013 +0300| [c8635094ceb8c43d6ae89ed37b4895b977343829] | committer: hpi1

BDGraphics: fixed default background to be transparent

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=c8635094ceb8c43d6ae89ed37b4895b977343829
---

 src/libbluray/bdj/java-j2me/java/awt/BDGraphics.java |    2 +-
 src/libbluray/bdj/java-j2se/java/awt/BDGraphics.java |    7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/libbluray/bdj/java-j2me/java/awt/BDGraphics.java b/src/libbluray/bdj/java-j2me/java/awt/BDGraphics.java
index bbd1825..87ad62e 100644
--- a/src/libbluray/bdj/java-j2me/java/awt/BDGraphics.java
+++ b/src/libbluray/bdj/java-j2me/java/awt/BDGraphics.java
@@ -121,7 +121,7 @@ class BDGraphics extends Graphics2D implements ConstrainableGraphics {
         if (foreground == null)
             foreground = DEFAULT_COLOR;
         if (background == null)
-            background = DEFAULT_COLOR;
+            background = new Color(0, 0, 0, 0);
         if (font == null)
             font = DEFAULT_FONT;
         fontMetrics = BDFontMetrics.getFontMetrics(font);
diff --git a/src/libbluray/bdj/java-j2se/java/awt/BDGraphics.java b/src/libbluray/bdj/java-j2se/java/awt/BDGraphics.java
index 8d47d02..660acc9 100644
--- a/src/libbluray/bdj/java-j2se/java/awt/BDGraphics.java
+++ b/src/libbluray/bdj/java-j2se/java/awt/BDGraphics.java
@@ -117,7 +117,9 @@ class BDGraphics extends Graphics2D implements ConstrainableGraphics {
         return background;
     }
     public void setBackground(Color c) {
-        background = c;
+        if (c != null) {
+            background = c;
+        }
     }
 
     BDGraphics(BDImage image) {
@@ -136,7 +138,7 @@ class BDGraphics extends Graphics2D implements ConstrainableGraphics {
         if (foreground == null)
             foreground = DEFAULT_COLOR;
         if (background == null)
-            background = DEFAULT_COLOR;
+            background = new Color(0, 0, 0, 0);
         if (font == null)
             font = DEFAULT_FONT;
         fontMetrics = BDFontMetrics.getFontMetrics(font);
@@ -265,6 +267,7 @@ class BDGraphics extends Graphics2D implements ConstrainableGraphics {
 
     public void setPaintMode() {
         xorColor = null;
+        composite = AlphaComposite.SrcOver;
     }
 
     public void setXORMode(Color color) {



More information about the libbluray-devel mailing list