moagrius / TileView

TileView is a subclass of android.view.ViewGroup that asynchronously displays, pans and zooms tile-based images. Plugins are available for features like markers, hotspots, and path drawing.
MIT License
1.46k stars 337 forks source link

SmoothScale to a position? #48

Closed Sikter closed 10 years ago

Sikter commented 10 years ago

I'm trying to achieve smooth scale to a given position in Tileview. I've used scrolling and sliding methods in TileView and ZoomPanLayout in combination with smoothScaleTo. Translation methods do their job, but smoothScaleTo always scales to provided destination scale but having the upper left corner of (0,0) in Tileview. Tried the frameViewport method, with similar results. Is there any preferred way of achieving this that I'm not aware of?

moagrius commented 10 years ago

Hmm, it should maintain scroll position - there were a couple updates to relevant methods in the last few months, maybe something got tweaked that shouldn't have. I'll take a look as soon as I get a moment and post back.

moagrius commented 10 years ago

You're right - there are several problems with this code. I'll try to get a patch included in the next commit. For now, you might want to try to fake a double-tap event.

moagrius commented 10 years ago

I was able to include a patch in the most recent commit and release. Thanks for contributing.