MikeOrtiz/TouchImageView

This 'setZoom' method is weird

SimFG opened this issue · 3 comments

SimFG commented

when I call setZoom(1.1f, 0, 0), the ImageView has an offset in the x direction and an offset in the Y direction.

floatMatrix!![Matrix.MTRANS_X] = (viewWidth - matchViewWidth) / 2 - focusX * (scale - 1) * matchViewWidth
floatMatrix!![Matrix.MTRANS_Y] = (viewHeight - matchViewHeight) / 2 - focusY * (scale - 1) * matchViewHeight

I think it might be more reasonable.

Please can you demonstrate it in ChangeSizeExampleActivity in a fork or pull request ?
Best with a screenshot

SimFG commented

I have pulled a request, and demonstrated it in the branch SetZoomOptCheck