Correct a bug on displaying caddy content when using 8bit height font

(like CBM font)
This time, with the correct y coordinate usage.
This commit is contained in:
gbouille 2018-12-31 11:05:17 +01:00
parent 39e737e935
commit e8e0b8428b
4 changed files with 260 additions and 260 deletions

View file

@ -298,7 +298,7 @@ void DiskCaddy::ShowSelectedImage(u32 index)
if (screenLCD)
{
unsigned numberOfImages = GetNumberOfImages();
unsigned numberOfDisplayedImages = screenLCD->Height()/screenLCD->GetFontHeight()-1;
unsigned numberOfDisplayedImages = (screenLCD->Height()/screenLCD->GetFontHeight())-1;
unsigned caddyIndex;
RGBA BkColour = RGBA(0, 0, 0, 0xFF);

View file

@ -100,7 +100,7 @@ private:
u32 selectedIndex;
u32 oldCaddyIndex;
Screen* screen;
ScreenBase* screen;
ScreenBase* screenLCD;
};

View file

@ -181,7 +181,7 @@ void FileBrowser::BrowsableListView::Refresh()
entryIndex = offset + index;
RefreshLine(entryIndex, x, y, /*showSelected && */list->currentIndex == entryIndex);
y += 16;
y += screen->GetFontHeight ();
}
screen->SwapBuffers();
@ -248,7 +248,7 @@ void FileBrowser::BrowsableListView::RefreshHighlightScroll()
int rowIndex = list->currentIndex - offset;
u32 y = positionY;
y += rowIndex * 16;
y += rowIndex * screen->GetFontHeight ();
RefreshLine(list->currentIndex, 0, y, true);

View file

@ -103,7 +103,7 @@ void ScreenLCD::PlotRawImage(const u8* image, int x, int y, int w, int h)
u32 ScreenLCD::PrintText(bool petscii, u32 x, u32 y, char *ptr, RGBA TxtColour, RGBA BkColour, bool measureOnly, u32* width, u32* height)
{
int len = 0;
ssd1306->PlotText(UseCBMFont(), petscii, x >> 3, y >> 4, ptr, (BkColour & 0xffffff) != 0);
ssd1306->PlotText(UseCBMFont(), petscii, x >> 3, y / GetFontHeight (), ptr, (BkColour & 0xffffff) != 0);
return len;
}