summaryrefslogtreecommitdiff
path: root/ffont.c
diff options
context:
space:
mode:
Diffstat (limited to 'ffont.c')
-rw-r--r--ffont.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ffont.c b/ffont.c
index 8aa15b0..952f891 100644
--- a/ffont.c
+++ b/ffont.c
@@ -206,7 +206,7 @@ int cVFDFont::DrawText(cVFDBitmap *Bitmap, int x, int y, const char *s, int Widt
uchar *buffer = g->Bitmap();
int symWidth = g->Width();
if (Width && x + symWidth + g->Left() + kerning - 1 > Width)
- return 1; // we don't draw partial characters
+ return x; // we don't draw partial characters
if (x + symWidth + g->Left() + kerning > 0) {
for (int row = 0; row < g->Rows(); row++) {
for (int pitch = 0; pitch < g->Pitch(); pitch++) {
@@ -222,11 +222,11 @@ int cVFDFont::DrawText(cVFDBitmap *Bitmap, int x, int y, const char *s, int Widt
}
x += g->AdvanceX() + kerning;
if (x > Bitmap->Width() - 1)
- return 1;
+ return x - (g->AdvanceX() + kerning);
}
- return 0;
+ return x;
}
- return -1;
+ return 0;
}