ZoomableTextureView icon indicating copy to clipboard operation
ZoomableTextureView copied to clipboard

Why is mScaleFactor determined twice?

Open tsuixh opened this issue 4 years ago • 0 comments

Very good open source library. Thank you in advance. But when I looked at the source code, I found that the same judgment was made twice. Is there any special reason? Here's the code: ua.polohalo.zoomabletextureview.ZoomableTextureView:

                    if (mScaleFactor < 1) {
                        matrix.getValues(m);
                        float x = m[Matrix.MTRANS_X];
                        float y = m[Matrix.MTRANS_Y];
                        if (mScaleFactor < 1) {
                            if (0 < getWidth()) {
                                if (y < -bottom)
                                    matrix.postTranslate(0, -(y + bottom));
                                else if (y > 0)
                                    matrix.postTranslate(0, -y);
                            } else {
                                if (x < -right)
                                    matrix.postTranslate(-(x + right), 0);
                                else if (x > 0)
                                    matrix.postTranslate(-x, 0);
                            }
                        }
                    }

tsuixh avatar Jan 06 '21 03:01 tsuixh