diff --git a/apps/circlesclock/ChangeLog b/apps/circlesclock/ChangeLog index cb5248e32..83abde6df 100644 --- a/apps/circlesclock/ChangeLog +++ b/apps/circlesclock/ChangeLog @@ -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 diff --git a/apps/circlesclock/app.js b/apps/circlesclock/app.js index 444040ef0..30d6a48f4 100644 --- a/apps/circlesclock/app.js +++ b/apps/circlesclock/app.js @@ -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}); } diff --git a/apps/circlesclock/metadata.json b/apps/circlesclock/metadata.json index 7b4c25532..1b94c00b3 100644 --- a/apps/circlesclock/metadata.json +++ b/apps/circlesclock/metadata.json @@ -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"}],