diff options
author | Keith Packard <keithp@keithp.com> | 2015-06-21 09:35:28 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2015-06-22 21:04:43 -0700 |
commit | 08e4e291d32bdb3ac3271a85190d277b1874d277 (patch) | |
tree | ff4b14ba44ff264392ef0d08267e943cebd0cde7 | |
parent | e0c318cdd32b3c3fed5099c754aea3ebc6186a0f (diff) |
altosuilib: Use AltosMap set_zoom_centre instead of in-line version
Shares the same function with altosdroid this way.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | altosuilib/AltosUIMapNew.java | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/altosuilib/AltosUIMapNew.java b/altosuilib/AltosUIMapNew.java index 5f63a3c2..246222bc 100644 --- a/altosuilib/AltosUIMapNew.java +++ b/altosuilib/AltosUIMapNew.java @@ -139,24 +139,7 @@ public class AltosUIMapNew extends JComponent implements AltosFlightDisplay, Alt public void mouseWheelMoved(MouseWheelEvent e) { int zoom_change = e.getWheelRotation(); - map.notice_user_input(); - AltosLatLon mouse_lat_lon = null; - - if (map.transform != null) - mouse_lat_lon = map.transform.screen_lat_lon(new AltosPointInt(e.getPoint().x, e.getPoint().y)); - - map.set_zoom(map.get_zoom() - zoom_change); - - if (mouse_lat_lon != null) { - AltosPointDouble new_mouse = map.transform.screen(mouse_lat_lon); - - int dx = getWidth()/2 - e.getPoint().x; - int dy = getHeight()/2 - e.getPoint().y; - - AltosLatLon new_centre = map.transform.screen_lat_lon(new AltosPointInt((int) new_mouse.x + dx, (int) new_mouse.y + dy)); - - map.centre(new_centre); - } + map.set_zoom_centre(map.get_zoom() - zoom_change, new AltosPointInt(e.getPoint().x, e.getPoint().y)); } /* ComponentListener methods */ |