Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ea2fa83c authored by Ruben Brunk's avatar Ruben Brunk
Browse files

Setup geometry xforms and propogation chain.

Bug: 8597538

Change-Id: I4a6b8ebcfadfd30850a73217742c740835761388
parent 1f60d9cd
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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.
     */
+6 −2
Original line number Diff line number Diff line
@@ -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);
    }