ZoomableTextureView
ZoomableTextureView copied to clipboard
Why is mScaleFactor determined twice?
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);
}
}
}