RTEditor/src/main/java/com/onegravity/rteditor/media/crop/CropImageView.java
private void ensureVisible(HighlightView hv) {
        Rect r = hv.mDrawRect;

        int panDeltaX1 = Math.max(0, mLeft - r.left);
        int panDeltaX2 = Math.min(0, mRight - r.right);

        int panDeltaY1 = Math.max(0, mTop - r.top);
        int panDeltaY2 = Math.min(0, mBottom - r.bottom);

        int panDeltaX = panDeltaX1 != 0 ? panDeltaX1 : panDeltaX2;
        int panDeltaY = panDeltaY1 != 0 ? panDeltaY1 : panDeltaY2;

        if (panDeltaX != 0 || panDeltaY != 0) {
            panBy(panDeltaX, panDeltaY);
        }
    }
private void ensureVisible(HighlightView hv) {
        Rect r = hv.mDrawRect;

        int panDeltaX1 = Math.max(0, mLeft - r.left);
        int panDeltaX2 = Math.min(0, mRight - r.right);

        int panDeltaY1 = Math.max(0, mTop - r.top);
        int panDeltaY2 = Math.min(0, mBottom - r.bottom);

        int panDeltaX = panDeltaX1 != 0 ? panDeltaX1 : panDeltaX2;
        int panDeltaY = panDeltaY1 != 0 ? panDeltaY1 : panDeltaY2;

        if (panDeltaX != 0 || panDeltaY != 0) {
            panBy(panDeltaX, panDeltaY);
        }
    }
private void ensureVisible ( HighlightView hv ) { Rect r = hv . mDrawRect ; int panDeltaX1 = Math . max ( 0 , mLeft - r . left ) ; int panDeltaX2 = Math . min ( 0 , mRight - r . right ) ; int panDeltaY1 = Math . max ( 0 , mTop - r . top ) ; int panDeltaY2 = Math . min ( 0 , mBottom - r . bottom ) ; int panDeltaX = panDeltaX1 != 0 ? panDeltaX1 : panDeltaX2 ; int panDeltaY = panDeltaY1 != 0 ? panDeltaY1 : panDeltaY2 ; if ( panDeltaX != 0 || panDeltaY != 0 ) { panBy ( panDeltaX , panDeltaY ) ; } }
Pan the displayed image to make sure the cropping rectangle is visible.
Pan the displayed image to make sure the cropping rectangle is visible .