Example usage for android.graphics RectF setEmpty

List of usage examples for android.graphics RectF setEmpty

Introduction

In this page you can find the example usage for android.graphics RectF setEmpty.

Prototype

public void setEmpty() 

Source Link

Document

Set the rectangle to (0,0,0,0)

Usage

From source file:com.facebook.litho.ComponentsPools.java

@ThreadSafe(enableChecks = false)
static void releaseRectF(RectF rect) {
    if (!ComponentsConfiguration.usePooling) {
        return;/*from  w w  w  .  j  a  v a  2 s .  c  o m*/
    }
    rect.setEmpty();
    sRectFPool.release(rect);
}

From source file:com.hippo.largeimageview.LargeImageView.java

private void applyRectInWindow() {
    final RectF dst = mDst;
    final RectF dstActual = mDstActual;
    final RectF srcActual = mSrcActual;

    dstActual.set(dst);/*from   w ww  .  ja v a  2 s.com*/
    if (dstActual.intersect(0, 0, mWindowWidth, mWindowHeight)) {
        if (dst.equals(dstActual)) {
            // Still dst
            srcActual.set(0, 0, mImageWidth, mImageHeight);
        } else {
            srcActual.left = lerp(0.0f, mImageWidth, norm(dst.left, dst.right, dstActual.left));
            srcActual.right = lerp(0.0f, mImageWidth, norm(dst.left, dst.right, dstActual.right));
            srcActual.top = lerp(0.0f, mImageHeight, norm(dst.top, dst.bottom, dstActual.top));
            srcActual.bottom = lerp(0.0f, mImageHeight, norm(dst.top, dst.bottom, dstActual.bottom));
        }
    } else {
        // Can't be seen, set src and dst empty
        srcActual.setEmpty();
        dstActual.setEmpty();
    }

    mRectDirty = false;
}