summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/imageshow/GeometryMath.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/gallery3d/filtershow/imageshow/GeometryMath.java')
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/GeometryMath.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/filtershow/imageshow/GeometryMath.java b/src/com/android/gallery3d/filtershow/imageshow/GeometryMath.java
index 33a3f73cb..55f791820 100644
--- a/src/com/android/gallery3d/filtershow/imageshow/GeometryMath.java
+++ b/src/com/android/gallery3d/filtershow/imageshow/GeometryMath.java
@@ -16,6 +16,7 @@
package com.android.gallery3d.filtershow.imageshow;
+import android.graphics.Rect;
import android.graphics.RectF;
public class GeometryMath {
@@ -99,4 +100,10 @@ public class GeometryMath {
return Math.min(newWidth / oldWidth , newHeight / oldHeight);
}
+ public static Rect roundNearest(RectF r){
+ Rect q = new Rect(Math.round(r.left), Math.round(r.top), Math.round(r.right),
+ Math.round(r.bottom));
+ return q;
+ }
+
}