Skip to content
Snippets Groups Projects
Commit 627a20ac authored by Tilman Vatteroth's avatar Tilman Vatteroth :robot:
Browse files

Clock akzeptiert jetzt auch einen transparenten Hintergrund

parent a105431b
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@ this.loaded = function(panel, config) {
dbgc = null,
afgc = analClock ? analClock.getContext("2d") : null,
abgc = null,
bgColor = panel.css("background-color"),
bgColor = null, //panel.css("background-color"),
sdColor = "#111",
icColor = "#FFF",
date = new Date(),
......@@ -217,6 +217,10 @@ this.loaded = function(panel, config) {
}
renderDigital = function(h, i, s, t, d, m, y) {
if (bgColor == null) {
dfgc.clearRect(0, 0, digitalWidth, digitalHeight);
}
dfgc.drawImage(digiBackground, 0, 0);
dfgc.fillStyle = icColor;
if (!seperatorOn) {
......@@ -236,6 +240,9 @@ this.loaded = function(panel, config) {
}
renderAnalog = function(h, i, s) {
if (bgColor == null) {
afgc.clearRect(-analogX, -analogY, analogWidth, analogHeight);
}
//debugger;
afgc.drawImage(analBackground, -analogX, -analogY);
afgc.strokeStyle = icColor;
......@@ -264,8 +271,12 @@ this.loaded = function(panel, config) {
}
renderDigiBackground = function() {
dbgc.fillStyle = bgColor;
dbgc.fillRect(0, 0, digitalWidth, digitalHeight);
if (bgColor == null) {
dbgc.clearRect(0, 0, digitalWidth, digitalHeight);
} else {
dbgc.fillStyle = bgColor;
dbgc.fillRect(0, 0, digitalWidth, digitalHeight);
}
dbgc.fillStyle = sdColor;
dbgc.font = fatFont;
dbgc.fillText(":", clockSeperatorX, clockSeperatorY);
......@@ -298,7 +309,12 @@ this.loaded = function(panel, config) {
bctx.drawImage(bc, 0, 0, oc.width, oc.height);
bc = oc;
}
abgc.fillRect(-analogX, -analogY, analogWidth, analogHeight);
if (bgColor == null) {
abgc.clearRect(-analogX, -analogY, analogWidth, analogHeight);
} else {
abgc.fillRect(-analogX, -analogY, analogWidth, analogHeight);
}
abgc.fillStyle = "black";
//abgc.drawImage(buffer, -analogRad, -analogRad, analogRad * 2, analogRad * 2);
abgc.drawImage(bc, -analogRad, -analogRad, analogRad * 2, analogRad * 2);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment