diff options
| author | Tor Norbye <tnorbye@google.com> | 2010-11-11 21:59:23 -0800 |
|---|---|---|
| committer | Tor Norbye <tnorbye@google.com> | 2010-11-11 21:59:23 -0800 |
| commit | 135f80dcb4a1fead062714a8f6fdcef288fdddd8 (patch) | |
| tree | d9990d9b59a75453af3078900b0254f65483b707 /tools | |
| parent | a4e28d181942018ba8759989799a28fa88764ce3 (diff) | |
| download | frameworks_base-135f80dcb4a1fead062714a8f6fdcef288fdddd8.zip frameworks_base-135f80dcb4a1fead062714a8f6fdcef288fdddd8.tar.gz frameworks_base-135f80dcb4a1fead062714a8f6fdcef288fdddd8.tar.bz2 | |
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
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/LayoutSceneImpl.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/LayoutSceneImpl.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/LayoutSceneImpl.java index 2012229..d8a59ce 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/LayoutSceneImpl.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/LayoutSceneImpl.java @@ -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(); } |
