Merge pull request #1796 from nxdefiant/master

miclock2: Redraw only when seconds change
pull/1798/head
Gordon Williams 2022-05-06 09:02:17 +01:00 committed by GitHub
commit d1873ad166
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -1 +1,2 @@
0.01: New App!
0.02: Redraw only when seconds change

View File

@ -6,6 +6,7 @@ const Radius = { "center": 7, "hour": 60, "min": 80, "dots": 88 };
const Center = { "x": 120, "y": 96 };
const Widths = { hour: 2, minute: 2 };
var buf = Graphics.createArrayBuffer(240,192,1,{msb:true});
var lastDate = new Date();
function rotatePoint(x, y, d) {
rad = -1 * d / 180 * Math.PI;
@ -45,10 +46,10 @@ function setLineWidth(x1, y1, x2, y2, lw) {
];
}
function drawMixedClock(force) {
if ((force || Bangle.isLCDOn()) && buf.buffer) {
var date = new Date();
var date = new Date();
if ((force || Bangle.isLCDOn()) && buf.buffer && date.getSeconds() === lastDate.getSeconds()) {
lastDate = date;
var dateArray = date.toString().split(" ");
var isEn = locale.name.startsWith("en");
var point = [];

View File

@ -1,7 +1,7 @@
{
"id": "miclock2",
"name": "Mixed Clock 2",
"version": "0.01",
"version": "0.02",
"description": "White color variant of the Mixed Clock with thicker clock hands for better readability in the bright sunlight, extra space under the clock for widgets and seconds in the digital clock.",
"icon": "clock-mixed.png",
"type": "clock",