From eebb625b9dbcf9d2a22e0401a89f8b2bd6ad8404 Mon Sep 17 00:00:00 2001 From: DiSlord Date: Mon, 9 Mar 2020 22:28:05 +0300 Subject: [PATCH] Always update marker info --- nanovna.h | 2 +- plot.c | 5 ++--- ui.c | 18 +++++++++--------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/nanovna.h b/nanovna.h index a618cb5..4a2063c 100644 --- a/nanovna.h +++ b/nanovna.h @@ -261,7 +261,7 @@ void redraw_frame(void); //void redraw_all(void); void request_to_draw_cells_behind_menu(void); void request_to_draw_cells_behind_numeric_input(void); -void redraw_marker(int marker, int update_info); +void redraw_marker(int marker); void plot_into_index(float measured[2][POINTS_COUNT][2]); void force_set_markmap(void); void draw_frequencies(void); diff --git a/plot.c b/plot.c index 0ee0c42..39d0e9b 100644 --- a/plot.c +++ b/plot.c @@ -1387,7 +1387,7 @@ draw_all(bool flush) } void -redraw_marker(int marker, int update_info) +redraw_marker(int marker) { if (marker < 0) return; @@ -1395,8 +1395,7 @@ redraw_marker(int marker, int update_info) markmap_marker(marker); // mark cells on marker info - if (update_info) - markmap_upperarea(); + markmap_upperarea(); draw_all_cells(TRUE); } diff --git a/ui.c b/ui.c index a2267da..268ec51 100644 --- a/ui.c +++ b/ui.c @@ -767,7 +767,7 @@ menu_marker_search_cb(int item, uint8_t data) if (i != -1) markers[active_marker].index = i; draw_menu(); - redraw_marker(active_marker, TRUE); + redraw_marker(active_marker); select_lever_mode(LM_SEARCH); } @@ -776,7 +776,7 @@ menu_marker_smith_cb(int item, uint8_t data) { (void)item; marker_smith_format = data; - redraw_marker(active_marker, TRUE); + redraw_marker(active_marker); draw_menu(); } @@ -822,7 +822,7 @@ menu_marker_sel_cb(int item, uint8_t data) } else if (item == 5) { /* marker delta */ uistat.marker_delta = !uistat.marker_delta; } - redraw_marker(active_marker, TRUE); + redraw_marker(active_marker); draw_menu(); } @@ -1639,18 +1639,18 @@ lever_move_marker(int status) if ((status & EVT_DOWN) && markers[active_marker].index > 0) { markers[active_marker].index--; markers[active_marker].frequency = frequencies[markers[active_marker].index]; - redraw_marker(active_marker, FALSE); + redraw_marker(active_marker); } if ((status & EVT_UP) && markers[active_marker].index < 100) { markers[active_marker].index++; markers[active_marker].frequency = frequencies[markers[active_marker].index]; - redraw_marker(active_marker, FALSE); + redraw_marker(active_marker); } } status = btn_wait_release(); } while (status != 0); if (active_marker >= 0) - redraw_marker(active_marker, TRUE); + redraw_marker(active_marker); } static void @@ -1664,7 +1664,7 @@ lever_search_marker(int status) i = marker_search_right(markers[active_marker].index); if (i != -1) markers[active_marker].index = i; - redraw_marker(active_marker, TRUE); + redraw_marker(active_marker); } } @@ -2067,7 +2067,7 @@ drag_marker(int t, int m) if (index >= 0) { markers[m].index = index; markers[m].frequency = frequencies[index]; - redraw_marker(m, TRUE); + redraw_marker(m); } } while(touch_check()!=EVT_TOUCH_RELEASED); } @@ -2097,7 +2097,7 @@ touch_pickup_marker(void) if (active_marker != m) { previous_marker = active_marker; active_marker = m; - redraw_marker(active_marker, TRUE); + redraw_marker(active_marker); } // select trace uistat.current_trace = t;