forked from FOSS/BangleApps
Merge pull request #2805 from trufae/sunrise2
Release sunrise 0.02, faster sinus and fix menu buttonmaster
commit
7fa165f421
|
@ -1 +1,2 @@
|
||||||
0.01: First release
|
0.01: First release
|
||||||
|
0.02: Faster sinus line and fix button to open menu
|
||||||
|
|
|
@ -13,6 +13,8 @@ function loadLocation () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bangle.setUI("clock");
|
||||||
|
Bangle.loadWidgets();
|
||||||
const latlon = loadLocation();
|
const latlon = loadLocation();
|
||||||
const lat = latlon.lat || 41.38;
|
const lat = latlon.lat || 41.38;
|
||||||
const lon = latlon.lon || 2.168;
|
const lon = latlon.lon || 2.168;
|
||||||
|
@ -177,6 +179,7 @@ function ypos (x) {
|
||||||
|
|
||||||
let sunRiseX = 0;
|
let sunRiseX = 0;
|
||||||
let sunSetX = 0;
|
let sunSetX = 0;
|
||||||
|
const sinStep = 12;
|
||||||
|
|
||||||
function drawSinuses () {
|
function drawSinuses () {
|
||||||
let x = 0;
|
let x = 0;
|
||||||
|
@ -187,14 +190,14 @@ function drawSinuses () {
|
||||||
let y = oy;
|
let y = oy;
|
||||||
for (i = 0; i < w; i++) {
|
for (i = 0; i < w; i++) {
|
||||||
x = i;
|
x = i;
|
||||||
x2 = x + 6;
|
x2 = x + sinStep + 1;
|
||||||
y2 = ypos(i);
|
y2 = ypos(i);
|
||||||
if (x == 0) {
|
if (x == 0) {
|
||||||
y = y2;
|
y = y2;
|
||||||
}
|
}
|
||||||
g.drawLine(x, y, x2, y2);
|
g.drawLine(x, y, x2, y2);
|
||||||
y = y2;
|
y = y2;
|
||||||
i += 5; // no need to draw all steps
|
i += sinStep; // no need to draw all steps
|
||||||
}
|
}
|
||||||
|
|
||||||
// sea level line
|
// sea level line
|
||||||
|
@ -293,7 +296,6 @@ function renderScreen () {
|
||||||
g.setBgColor(0, 0, 0);
|
g.setBgColor(0, 0, 0);
|
||||||
g.clear();
|
g.clear();
|
||||||
if (realTime) {
|
if (realTime) {
|
||||||
Bangle.loadWidgets();
|
|
||||||
Bangle.drawWidgets();
|
Bangle.drawWidgets();
|
||||||
}
|
}
|
||||||
drawGlow();
|
drawGlow();
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "sunrise",
|
"id": "sunrise",
|
||||||
"name": "Sunrise",
|
"name": "Sunrise",
|
||||||
"shortName": "Sunrise",
|
"shortName": "Sunrise",
|
||||||
"version": "0.01",
|
"version": "0.02",
|
||||||
"type": "clock",
|
"type": "clock",
|
||||||
"description": "Show sunrise and sunset times",
|
"description": "Show sunrise and sunset times",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
|
|
Loading…
Reference in New Issue