From 746ce7d4067fc5f31c6e540e4179583f7713ba58 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Tue, 6 Mar 2018 10:38:18 +0100 Subject: [PATCH] Fixed keeping the offset of the list cursor in case it is at the very top of the visible part of the list --- osdbase.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osdbase.c b/osdbase.c index dea1d995..1720022d 100644 --- a/osdbase.c +++ b/osdbase.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: osdbase.c 4.3 2017/11/07 15:42:47 kls Exp $ + * $Id: osdbase.c 4.4 2018/03/06 10:38:18 kls Exp $ */ #include "osdbase.h" @@ -92,7 +92,7 @@ cOsdMenu::cOsdMenu(const char *Title, int c0, int c1, int c2, int c3, int c4) SetTitle(Title); SetCols(c0, c1, c2, c3, c4); first = 0; - lastOffset = 0; + lastOffset = -1; current = marked = -1; subMenu = NULL; helpRed = helpGreen = helpYellow = helpBlue = NULL; @@ -282,9 +282,9 @@ void cOsdMenu::Display(void) void cOsdMenu::SetCurrent(cOsdItem *Item) { current = Item ? Item->Index() : -1; - if (current >= 0 && lastOffset > 0) + if (current >= 0 && lastOffset >= 0) first = max(0, current - lastOffset); - lastOffset = 0; + lastOffset = -1; } void cOsdMenu::RefreshCurrent(void)