Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 135f80dc authored by Tor Norbye's avatar Tor Norbye
Browse files

Fix fill color alpha in layoutlib

new Color(int) ignores the upper 8 bits - it creates a color without
an alpha channel.  In order to pass in rgba we have to use a different
constructor, new Color(int,true).

(In the layout library API we should also specify that the custom
color, if specified, needs to include an alpha, or in particular add
in 0xFF<<24 if the color is opaque.)

Change-Id: I1c44caed8a5780e61b1c799f3b45bef3eb7bc97b
parent a4e28d18
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -295,7 +295,7 @@ public class LayoutSceneImpl {

            if (mParams.isCustomBackgroundEnabled()) {
                Graphics2D gc = mImage.createGraphics();
                gc.setColor(new Color(mParams.getCustomBackgroundColor()));
                gc.setColor(new Color(mParams.getCustomBackgroundColor(), true));
                gc.fillRect(0, 0, renderScreenWidth, renderScreenHeight - mScreenOffset);
                gc.dispose();
            }