Geomap enhancements (#1767)

* Increase Geomap zoom-in ability
* Use floating point for current position
* Show grid squares when zoomed in too much for map
* Zoom in fast after exceeding map resolution & clean up redundant code
* Revert order of functions to make it easier to review
* Changed grid color for better contrast with markers
* Optimizations
* Set x_pos/x_pos to center pixel versus upper left corner
* Show more distant planes when zoomed out
* Correct pixel offset when zooming in
* Fix oops in x_pos/y_pos centering change
* Wrapping support for lat/lon fields
* Wrapping support (for Geomap lat/lon fields)
* Handle wrapping for negative lat/lon
This commit is contained in:
Mark Thompson 2024-01-16 02:30:31 -06:00 committed by GitHub
parent ae9d6de093
commit bc301c5fdb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 269 additions and 159 deletions

View file

@ -31,7 +31,7 @@
#include "chprintf.h"
#include "irq_controls.hpp"
#include "string_format.hpp"
#include "usb_serial_device_to_host.h"
#include "usb_serial_io.h"
using namespace portapack;
@ -2118,7 +2118,15 @@ bool NumberField::on_key(const KeyEvent key) {
}
bool NumberField::on_encoder(const EncoderEvent delta) {
int32_t old_value = value();
set_value(value() + (delta * step));
if (on_wrap) {
if ((delta > 0) && (value() < old_value))
on_wrap(1);
else if ((delta < 0) && (value() > old_value))
on_wrap(-1);
}
return true;
}