summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorOwen Lin <owenlin@google.com>2012-05-15 09:59:19 -0700
committerOwen Lin <owenlin@google.com>2012-05-17 12:48:11 -0700
commit3bbcbcd5f908cef5c0bf7078c3352185f1ff6ddc (patch)
treea61b3a731666f3297e141a29d1280c3528bd69f4 /graphics
parentf970c2e6de52ef0da91c3c8f3b48a44303d0eb73 (diff)
downloadframeworks_base-3bbcbcd5f908cef5c0bf7078c3352185f1ff6ddc.zip
frameworks_base-3bbcbcd5f908cef5c0bf7078c3352185f1ff6ddc.tar.gz
frameworks_base-3bbcbcd5f908cef5c0bf7078c3352185f1ff6ddc.tar.bz2
Release the constraint on the requested version.
Allowing to request a region that partially outsides the image. bug: 5884845 Change-Id: I32344930ab9e2a7f22a706914babb165843e8de7
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/graphics/BitmapRegionDecoder.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/graphics/java/android/graphics/BitmapRegionDecoder.java b/graphics/java/android/graphics/BitmapRegionDecoder.java
index 496e0c7..c1d3407 100644
--- a/graphics/java/android/graphics/BitmapRegionDecoder.java
+++ b/graphics/java/android/graphics/BitmapRegionDecoder.java
@@ -180,9 +180,9 @@ public final class BitmapRegionDecoder {
*/
public Bitmap decodeRegion(Rect rect, BitmapFactory.Options options) {
checkRecycled("decodeRegion called on recycled region decoder");
- if (rect.left < 0 || rect.top < 0 || rect.right > getWidth()
- || rect.bottom > getHeight())
- throw new IllegalArgumentException("rectangle is not inside the image");
+ if (rect.right <= 0 || rect.bottom <= 0 || rect.left >= getWidth()
+ || rect.top >= getHeight())
+ throw new IllegalArgumentException("rectangle is outside the image");
return nativeDecodeRegion(mNativeBitmapRegionDecoder, rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top, options);
}