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) { ...@@ -18,7 +18,7 @@ this.loaded = function(panel, config) {
dbgc = null, dbgc = null,
afgc = analClock ? analClock.getContext("2d") : null, afgc = analClock ? analClock.getContext("2d") : null,
abgc = null, abgc = null,
bgColor = panel.css("background-color"), bgColor = null, //panel.css("background-color"),
sdColor = "#111", sdColor = "#111",
icColor = "#FFF", icColor = "#FFF",
date = new Date(), date = new Date(),
...@@ -217,6 +217,10 @@ this.loaded = function(panel, config) { ...@@ -217,6 +217,10 @@ this.loaded = function(panel, config) {
} }
renderDigital = function(h, i, s, t, d, m, y) { renderDigital = function(h, i, s, t, d, m, y) {
if (bgColor == null) {
dfgc.clearRect(0, 0, digitalWidth, digitalHeight);
}
dfgc.drawImage(digiBackground, 0, 0); dfgc.drawImage(digiBackground, 0, 0);
dfgc.fillStyle = icColor; dfgc.fillStyle = icColor;
if (!seperatorOn) { if (!seperatorOn) {
...@@ -236,6 +240,9 @@ this.loaded = function(panel, config) { ...@@ -236,6 +240,9 @@ this.loaded = function(panel, config) {
} }
renderAnalog = function(h, i, s) { renderAnalog = function(h, i, s) {
if (bgColor == null) {
afgc.clearRect(-analogX, -analogY, analogWidth, analogHeight);
}
//debugger; //debugger;
afgc.drawImage(analBackground, -analogX, -analogY); afgc.drawImage(analBackground, -analogX, -analogY);
afgc.strokeStyle = icColor; afgc.strokeStyle = icColor;
...@@ -264,8 +271,12 @@ this.loaded = function(panel, config) { ...@@ -264,8 +271,12 @@ this.loaded = function(panel, config) {
} }
renderDigiBackground = function() { renderDigiBackground = function() {
dbgc.fillStyle = bgColor; if (bgColor == null) {
dbgc.fillRect(0, 0, digitalWidth, digitalHeight); dbgc.clearRect(0, 0, digitalWidth, digitalHeight);
} else {
dbgc.fillStyle = bgColor;
dbgc.fillRect(0, 0, digitalWidth, digitalHeight);
}
dbgc.fillStyle = sdColor; dbgc.fillStyle = sdColor;
dbgc.font = fatFont; dbgc.font = fatFont;
dbgc.fillText(":", clockSeperatorX, clockSeperatorY); dbgc.fillText(":", clockSeperatorX, clockSeperatorY);
...@@ -298,7 +309,12 @@ this.loaded = function(panel, config) { ...@@ -298,7 +309,12 @@ this.loaded = function(panel, config) {
bctx.drawImage(bc, 0, 0, oc.width, oc.height); bctx.drawImage(bc, 0, 0, oc.width, oc.height);
bc = oc; 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.fillStyle = "black";
//abgc.drawImage(buffer, -analogRad, -analogRad, analogRad * 2, analogRad * 2); //abgc.drawImage(buffer, -analogRad, -analogRad, analogRad * 2, analogRad * 2);
abgc.drawImage(bc, -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