Merge pull request #119 from gbouille/CaddyDisplayBug

Correct a bug on displaying caddy content when using 8bit height font
This commit is contained in:
Stephen White 2019-01-02 11:51:03 +11:00 committed by GitHub
commit 6745e11ed1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
}