Let's assume I have some pin view which I want to render on top of PhotoView according current scale and zoom (aka simplified TileView).
PhotoView provide method setOnMatrixChangeListener when we zoom or scroll image it will trigger with displayed matrix parameter which is represented as RectF type.
So my question is how properly calculate positioning and scale of pin view on top of PhotoView depending on current zoom and scroll?
photView.setOnMatrixChangeListener(object: OnMatrixChangedListener {
override fun onMatrixChanged(rect: RectF?) {
// calculation of new coordinates and scale here
...
pinView.x = calculatedCoordinateX;
pinView.y = calculatedCoordinateY;
pinView.scale = calculatedScale;
}
})
Any material to study how to use such matrix for such calculation, positioning and scale?
Appreciate if anyone can provide sample code how exactly to solve such problem.