mirror of https://github.com/espruino/BangleApps
parent
77e6bd3a8d
commit
dd27b11eb8
|
@ -119,15 +119,14 @@ var state = {
|
||||||
|
|
||||||
function sizeFont(id, txt, w) {
|
function sizeFont(id, txt, w) {
|
||||||
let sz = fontszCache[id];
|
let sz = fontszCache[id];
|
||||||
if (sz) {
|
if (!sz) {
|
||||||
g.setFont("Vector", sz);
|
|
||||||
} else {
|
|
||||||
sz = TOKEN_DIGITS_HEIGHT;
|
sz = TOKEN_DIGITS_HEIGHT;
|
||||||
do {
|
do {
|
||||||
g.setFont("Vector", sz--);
|
g.setFont("Vector", sz--);
|
||||||
} while (g.stringWidth(txt) > w);
|
} while (g.stringWidth(txt) > w);
|
||||||
fontszCache[id] = sz + 1;
|
fontszCache[id] = ++sz;
|
||||||
}
|
}
|
||||||
|
g.setFont("Vector", sz);
|
||||||
}
|
}
|
||||||
|
|
||||||
tokenY = id => id * TOKEN_HEIGHT + AR.y - state.listy;
|
tokenY = id => id * TOKEN_HEIGHT + AR.y - state.listy;
|
||||||
|
|
Loading…
Reference in New Issue