From df618b2990f09943c91381807c90066e8e3de3fc Mon Sep 17 00:00:00 2001 From: bluebrother Date: Fri, 29 Dec 2006 19:17:03 +0000 Subject: [PATCH] Respect the progressbar length when drawing AB markers. Fixes FS#6463. Also fix a function name typo. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11857 a1c6a512-1295-4272-9138-f99709370657 --- apps/abrepeat.c | 17 ++++++++--------- apps/abrepeat.h | 2 +- apps/gui/gwps-common.c | 3 ++- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/abrepeat.c b/apps/abrepeat.c index caf76ff12..f1a430b89 100644 --- a/apps/abrepeat.c +++ b/apps/abrepeat.c @@ -166,7 +166,7 @@ static inline int ab_calc_mark_x_pos(int mark, int capacity, return offset + ( (w * mark) / capacity ); } -static inline void ab_draw_veritcal_line_mark(struct screen * screen, +static inline void ab_draw_vertical_line_mark(struct screen * screen, int x, int y, int h) { screen->set_drawmode(DRMODE_COMPLEMENT); @@ -192,20 +192,19 @@ static inline void ab_draw_arrow_mark(struct screen * screen, } void ab_draw_markers(struct screen * screen, int capacity, - int x, int y, int h) + int x0, int x1, int y, int h) { - int w = screen->width; /* if both markers are set, determine if they're far enough apart to draw arrows */ if ( ab_A_marker_set() && ab_B_marker_set() ) { - int xa = ab_calc_mark_x_pos(ab_A_marker, capacity, x, w); - int xb = ab_calc_mark_x_pos(ab_B_marker, capacity, x, w); + int xa = ab_calc_mark_x_pos(ab_A_marker, capacity, x0, x1); + int xb = ab_calc_mark_x_pos(ab_B_marker, capacity, x0, x1); int arrow_width = (h+1) / 2; if ( (xb-xa) < (arrow_width*2) ) { - ab_draw_veritcal_line_mark(screen, xa, y, h); - ab_draw_veritcal_line_mark(screen, xb, y, h); + ab_draw_vertical_line_mark(screen, xa, y, h); + ab_draw_vertical_line_mark(screen, xb, y, h); } else { @@ -217,12 +216,12 @@ void ab_draw_markers(struct screen * screen, int capacity, { if (ab_A_marker_set()) { - int xa = ab_calc_mark_x_pos(ab_A_marker, capacity, x, w); + int xa = ab_calc_mark_x_pos(ab_A_marker, capacity, x0, x1); ab_draw_arrow_mark(screen, xa, y, h, DIRECTION_RIGHT); } if (ab_B_marker_set()) { - int xb = ab_calc_mark_x_pos(ab_B_marker, capacity, x, w); + int xb = ab_calc_mark_x_pos(ab_B_marker, capacity, x0, x1); ab_draw_arrow_mark(screen, xb, y, h, DIRECTION_LEFT); } } diff --git a/apps/abrepeat.h b/apps/abrepeat.h index d7bed0a99..27b3dc259 100644 --- a/apps/abrepeat.h +++ b/apps/abrepeat.h @@ -49,7 +49,7 @@ void ab_end_of_track_report(void); #ifdef HAVE_LCD_BITMAP #include "screen_access.h" void ab_draw_markers(struct screen * screen, int capacity, - int x, int y, int h); + int x0, int x1, int y, int h); #endif /* These functions really need to be inlined for speed */ diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index 51d62d016..f2aa49770 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c @@ -1840,7 +1840,8 @@ bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset, HORIZONTAL); #ifdef AB_REPEAT_ENABLE if ( ab_repeat_mode_enabled() ) - ab_draw_markers(display, state->id3->length, 0, sb_y, + ab_draw_markers(display, state->id3->length, + data->progress_start, data->progress_end, sb_y, data->progress_height); #endif update_line = true; -- 2.11.4.GIT