Make themperature value readable on smaller screens

master
Marco H 2021-12-14 15:52:22 +01:00 committed by GitHub
parent cfe70de6b8
commit e9436eca15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -4,7 +4,7 @@ function onTemperature(p) {
var x = g.getWidth()/2;
var y = g.getHeight()/2 + 10;
g.drawString("Temperature:", x, y - 45);
g.setFontVector(70).setFontAlign(0,0);
g.setFontVector(g.getWidth() > 200 ? 70 : 40).setFontAlign(0,0);
g.drawString(p.temperature.toFixed(1) + " °C", x, y);
}