1
0
Fork 0

Merge pull request #2397 from glemco/master

circlesclock: fixed crash if item has no image and cutting long text
master
Gordon Williams 2022-12-14 14:58:45 +00:00 committed by GitHub
commit 44d6cdb6e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View File

@ -38,3 +38,4 @@
Add fast load capability
0.21: Remade all icons without a palette for dark theme
Now re-adds widgets if they were hidden when fast-loading
0.22: Fixed crash if item has no image and cutting long overflowing text

View File

@ -183,9 +183,12 @@ let drawCircle = function(index, item, data) {
if (txt.endsWith(" bpm")) txt=txt.slice(0,-4); // hack for heart rate - remove the 'bpm' text
if(item.hasRange) percent = (data.v-data.min) / (data.max-data.min);
if(data.short) txt = data.short;
//long text can overflow and we do not draw there anymore..
if(txt.length>6) txt = txt.slice(0,5)+"\n"+txt.slice(5,10)
drawGauge(w, h3, percent, color);
drawInnerCircleAndTriangle(w);
writeCircleText(w, txt);
if(!img) return; //or get it from the clkinfo?
g.setColor(getCircleIconColor(index, color, percent))
.drawImage(img, w - iconOffset, h3 + radiusOuter - iconOffset, {scale: 16/24});
}

View File

@ -1,7 +1,7 @@
{ "id": "circlesclock",
"name": "Circles clock",
"shortName":"Circles clock",
"version":"0.21",
"version":"0.22",
"description": "A clock with three or four circles for different data at the bottom in a probably familiar style",
"icon": "app.png",
"screenshots": [{"url":"screenshot-dark.png"}, {"url":"screenshot-light.png"}, {"url":"screenshot-dark-4.png"}, {"url":"screenshot-light-4.png"}],