summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/font.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/firmware/font.c b/firmware/font.c
index 2be90355db..e6f90e4ca5 100644
--- a/firmware/font.c
+++ b/firmware/font.c
@@ -93,8 +93,10 @@ static int buflibmove_callback(int handle, void* current, void* new)
93 if (alloc->handle_locked) 93 if (alloc->handle_locked)
94 return BUFLIB_CB_CANNOT_MOVE; 94 return BUFLIB_CB_CANNOT_MOVE;
95 95
96 alloc->font.bits += diff; 96 if (alloc->font.bits)
97 alloc->font.offset += diff; 97 alloc->font.bits += diff;
98 if (alloc->font.offset)
99 alloc->font.offset += diff;
98 if (alloc->font.width) 100 if (alloc->font.width)
99 alloc->font.width += diff; 101 alloc->font.width += diff;
100 102
@@ -102,8 +104,10 @@ static int buflibmove_callback(int handle, void* current, void* new)
102 alloc->font.buffer_end += diff; 104 alloc->font.buffer_end += diff;
103 alloc->font.buffer_position += diff; 105 alloc->font.buffer_position += diff;
104 106
105 alloc->font.cache._index += diff; 107 if (alloc->font.cache._index)
106 alloc->font.cache._lru._base += diff; 108 alloc->font.cache._index += diff;
109 if (alloc->font.cache._lru._base)
110 alloc->font.cache._lru._base += diff;
107 111
108 return BUFLIB_CB_OK; 112 return BUFLIB_CB_OK;
109} 113}