summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2012-04-30 14:05:09 -0700
committerDianne Hackborn <hackbod@google.com>2012-04-30 14:51:48 -0700
commit76344241719384f160ee623554f66987d0fcae41 (patch)
tree97ba015c58ae17bff2eb3b16fb9f51fa89962c39 /graphics
parent3ea8761974a530218a246dc73583c8820b12bf0b (diff)
downloadframeworks_base-76344241719384f160ee623554f66987d0fcae41.zip
frameworks_base-76344241719384f160ee623554f66987d0fcae41.tar.gz
frameworks_base-76344241719384f160ee623554f66987d0fcae41.tar.bz2
Fix scaling of layout bounds.
Change-Id: I9d8c8924900fed69030ee3e8d6decee89ca67820
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/graphics/BitmapFactory.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/BitmapFactory.java b/graphics/java/android/graphics/BitmapFactory.java
index 1599e40..5094df18 100644
--- a/graphics/java/android/graphics/BitmapFactory.java
+++ b/graphics/java/android/graphics/BitmapFactory.java
@@ -556,6 +556,7 @@ public class BitmapFactory {
return bm;
}
byte[] np = bm.getNinePatchChunk();
+ int[] lb = bm.getLayoutBounds();
final boolean isNinePatch = np != null && NinePatch.isNinePatchChunk(np);
if (opts.inScaled || isNinePatch) {
float scale = targetDensity / (float) density;
@@ -569,6 +570,13 @@ public class BitmapFactory {
np = nativeScaleNinePatch(np, scale, outPadding);
bm.setNinePatchChunk(np);
}
+ if (lb != null) {
+ int[] newLb = new int[lb.length];
+ for (int i=0; i<lb.length; i++) {
+ newLb[i] = (int)((lb[i]*scale)+.5f);
+ }
+ bm.setLayoutBounds(newLb);
+ }
}
bm.setDensity(targetDensity);