Fix wallpaper cropping bugs

- take into account that image decoder might not
respect inSampleSize
- check rounded values so we don't have crop rects
that lie outside a bitmap's dimensions
- correctly set initial scale on bitmaps that are
larger than the screen size

Change-Id: I42be79c68b883a6e329dcc5645d7db6cd6e3eeeb
This commit is contained in:
Michael Jurka
2013-11-11 16:44:44 +01:00
parent 62dacd6797
commit 2d13e6934f
2 changed files with 30 additions and 2 deletions
+2 -1
View File
@@ -165,7 +165,8 @@ public class CropView extends TiledImageView implements OnScaleGestureListener {
final float imageWidth = imageDims[0];
final float imageHeight = imageDims[1];
mMinScale = Math.max(w / imageWidth, h / imageHeight);
mRenderer.scale = Math.max(mMinScale, mRenderer.scale);
mRenderer.scale =
Math.max(mMinScale, resetScale ? Float.MIN_VALUE : mRenderer.scale);
}
}
}