From c91623b7801650d38a3492ca3e7ce66e3523b51c Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Sun, 12 Mar 2006 13:44:51 +0000 Subject: Oscilloscope: Don't print speed messages at an irritanting position (i.e. wrapped) * Print speed messages in horizontal mode (as number only). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9013 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/oscilloscope.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c index baaf25d2b0..3c20d39500 100644 --- a/apps/plugins/oscilloscope.c +++ b/apps/plugins/oscilloscope.c @@ -300,6 +300,19 @@ void anim_horizontal(int cur_left, int cur_right) last_left = cur_left; last_right = cur_right; + if (displaymsg) + { + int width; + + rb->lcd_getstringsize(message, &width, NULL); + last_pos -= width - 1; + rb->lcd_putsxy(last_pos, 0, message); + displaymsg = false; + + if (last_pos < 0) + last_pos = 0; + } + if (full_update) { rb->lcd_update(); @@ -468,11 +481,11 @@ void anim_vertical(int cur_left, int cur_right) if (displaymsg) { last_pos -= font_height - 1; - if (last_pos < 0) - last_pos = LCD_HEIGHT - font_height; - rb->lcd_putsxy(0, last_pos, message); displaymsg = false; + + if (last_pos < 0) + last_pos = 0; } if (full_update) @@ -651,7 +664,9 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) if (tell_speed) { - rb->snprintf(message, sizeof(message), "Speed: %d", 100 / osc.delay); + rb->snprintf(message, sizeof(message), "%s%d", + (osc.orientation == OSC_VERT) ? "Speed: " : "", + 100 / osc.delay); displaymsg = true; } } -- cgit v1.2.3