Code example for Matrix

Methods: getValues, postTranslate

0
            return true; 
        } 
    } 
 
    void fixTrans() { 
        matrix.getValues(m);
        float transX = m[Matrix.MTRANS_X];
        float transY = m[Matrix.MTRANS_Y];
         
        float fixTransX = getFixTrans(transX, viewWidth, origWidth * saveScale);
        float fixTransY = getFixTrans(transY, viewHeight, origHeight * saveScale);
 
        if (fixTransX != 0 || fixTransY != 0)
            matrix.postTranslate(fixTransX, fixTransY);
    } 
 
    float getFixTrans(float trans, float viewSize, float contentSize) {
        float minTrans, maxTrans;
 
        if (contentSize <= viewSize) {
            minTrans = 0;