forked from ham-radio-software/D-Rats
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Info Window, Remove fudge factor. (#57)
Added the info window functionality. Finally found the way to convert between display coordinates and point positions with out using fudge factors. Fixed up minor issues with marker display. d_rats/map/mapdraw.py: remove unused get_map_base method. Move calculating map to display offset to MapTile class. In draw_image_at method, center icon over point. in draw_marker method, use Map.Tile.deg2display() instead of latlon2xy. In draw_marker method, remove fudge factor usage. in draw_text_marker_at method, Make sure text is centered on point. In expose_map method, refactor to use MapTile methods to reduce code duplication in other methods. d_rats/map/maptile.py: Add _set_x_origin method to calculate and store display origin as a class variable. Add get_display_center as a class method, as a common method of getting the center tile offset. Add get_display_limits to return number of display pixels for each axis. Add get_display_tile_limits to return number of tiles for each axis. Add get_display_origin to return the offset of the display from the map tile numbers. Add set_center method to store the center position of the map. In the set_map_widget method store the the requested tile limits for each axis as class variables In the set_zoom method, calculate and store the maximum number of tiles to avoid doing that calculation for every coordinate to or from degree method called. Removed unused deg2pixel method. Add deg2display method to replace latlon2xy method and eliminate fudge factors. Add display2deg method to replace xy2latlon method and eliminate fudge factors. d_rats/map/mapwidget.py: Simplify calculate_bounds method, remove fudge factor calculation. Remove latlon2xy and xy2latlon methods. d_rats/map/mapwindow.py: Implement the Info Window mouse popup for points. Shorten the mouse movement timer from 10 to 5 to be more responsive. Co-authored-by: John E. Malmberg <wb8tyw@gmail.com>
- Loading branch information
1 parent
c9ba985
commit 66a6fd1
Showing
3 changed files
with
154 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.