diff --git a/panels/clock/script.js b/panels/clock/script.js index f5f8f26da2e5bf9d2da847880be0d00d406bcbd2..4d8554f438eb46f1c59d79736638792a59e84b20 100755 --- a/panels/clock/script.js +++ b/panels/clock/script.js @@ -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);