OSDN Git Service

Setup geometry xforms and propogation chain.
authorRuben Brunk <rubenbrunk@google.com>
Thu, 11 Apr 2013 19:39:03 +0000 (12:39 -0700)
committerRuben Brunk <rubenbrunk@google.com>
Thu, 11 Apr 2013 20:08:31 +0000 (13:08 -0700)
Bug: 8597538

Change-Id: I4a6b8ebcfadfd30850a73217742c740835761388

src/com/android/gallery3d/filtershow/crop/BoundedRect.java
src/com/android/gallery3d/filtershow/crop/CropObject.java

index c2c768e..74ce7cd 100644 (file)
@@ -53,6 +53,16 @@ public class BoundedRect {
             reconstrain();
     }
 
+    public void resetTo(float rotation, RectF outerRect, RectF innerRect) {
+        rot = rotation;
+        outer.set(outerRect);
+        inner.set(innerRect);
+        innerRotated = CropMath.getCornersFromRect(inner);
+        rotateInner();
+        if (!isConstrained())
+            reconstrain();
+    }
+
     /**
      * Sets inner, and re-constrains it to fit within the rotated bounding rect.
      */
index 00baba9..08cf158 100644 (file)
@@ -55,11 +55,15 @@ public class CropObject {
         mBoundedRect = new BoundedRect(outerAngle % 360, outerBound, innerBound);
     }
 
-    public void setToInnerBounds(RectF r) {
+    public void resetBoundsTo(RectF inner, RectF outer) {
+        mBoundedRect.resetTo(0, outer, inner);
+    }
+
+    public void getInnerBounds(RectF r) {
         mBoundedRect.setToInner(r);
     }
 
-    public void setToOuterBounds(RectF r) {
+    public void getOuterBounds(RectF r) {
         mBoundedRect.setToOuter(r);
     }