gluonhq / maps

https://gluonhq.com/labs/maps/
GNU General Public License v3.0
140 stars 36 forks source link

Add a method to get a map position for a given scene coordinate #3

Closed tkuenneth closed 6 years ago

tkuenneth commented 7 years ago

This pull request adds a method to get a map position for a given scene coordinate. The use case for this is to be able to place something on a layer based on the location within a scene, for example after a mouse button has been pressed.

As you can see, existing code in calculateCenterCoords() has been reused by refactoring it into a new method called calculateCoords(), which is called from calculateCenterCoords().