mirror of
https://github.com/m5stack/meshtastic-device-ui.git
synced 2026-05-20 11:51:03 -07:00
fix: map scrolling (#101)
* prepare for map unit tests; fix scroll issue * add map scroll unit tests * force redraw on internal scroll error (kinda self-healing)
This commit is contained in:
@@ -24,6 +24,8 @@ bool MapTile::load(lv_obj_t *p, int16_t posx, int16_t posy, const lv_image_dsc_t
|
||||
{
|
||||
x = posx;
|
||||
y = posy;
|
||||
if (!p)
|
||||
return false;
|
||||
removeImage();
|
||||
img = lv_image_create(p);
|
||||
lv_obj_set_pos(img, posx, posy);
|
||||
@@ -76,7 +78,8 @@ bool MapTile::move(int16_t posx, int16_t posy)
|
||||
{
|
||||
x += posx;
|
||||
y += posy;
|
||||
lv_obj_set_pos(img, x, y);
|
||||
if (img)
|
||||
lv_obj_set_pos(img, x, y);
|
||||
if (MapTileSettings::getDebug()) {
|
||||
lv_label_set_text_fmt(lbl, "(%d/%d/%d) -> %d,%d", MapTileSettings::getZoomLevel(), xTile, yTile, x, y);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user