mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-25 15:20:31 -04:00
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:
parent
ae9d6de093
commit
bc301c5fdb
4 changed files with 269 additions and 159 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue