private void savePreviousImageValues() {
        if (matrix != null && viewHeight != 0 && viewWidth != 0) {
            matrix.getValues(m);
            prevMatrix.setValues(m);
            prevMatchViewHeight = matchViewHeight;
            prevMatchViewWidth = matchViewWidth;
            prevViewHeight = viewHeight;
            prevViewWidth = viewWidth;
        }
    }
Save the current matrix and view dimensions
in the prevMatrix and prevView variables.
app/src/main/java/com/rozdoum/socialcomponents/views/TouchImageView.java