Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #5 from maslennikov/master

Why not decorations on hour and minute hands?
  • Loading branch information...
commit b664e3326cb0618ce167d30e5b0e23a28121a49a 2 parents a656938 + fb53847
@simonbaird authored
Showing with 19 additions and 7 deletions.
  1. +19 −7 coolclock.js
View
26 coolclock.js
@@ -241,20 +241,32 @@ CoolClock.prototype = {
this.renderRadius+this.renderRadius/2
);
}
+
+ var hourA = (hour%12)*5 + min/12.0,
+ minA = min + sec/60.0,
+ secA = sec;
// Draw the hands
if (skin.hourHand)
- this.radialLineAtAngle(this.tickAngle(((hour%12)*5 + min/12.0)),skin.hourHand);
+ this.radialLineAtAngle(this.tickAngle(hourA),skin.hourHand);
if (skin.minuteHand)
- this.radialLineAtAngle(this.tickAngle((min + sec/60.0)),skin.minuteHand);
+ this.radialLineAtAngle(this.tickAngle(minA),skin.minuteHand);
if (this.showSecondHand && skin.secondHand)
- this.radialLineAtAngle(this.tickAngle(sec),skin.secondHand);
-
- // Second hand decoration doesn't render right in IE so lets turn it off
- if (!CoolClock.config.isIE && this.showSecondHand && skin.secondDecoration)
- this.radialLineAtAngle(this.tickAngle(sec),skin.secondDecoration);
+ this.radialLineAtAngle(this.tickAngle(secA),skin.secondHand);
+
+ // Hands decoration - not in IE
+ if (!CoolClock.config.isIE) {
+ if (skin.hourDecoration)
+ this.radialLineAtAngle(this.tickAngle(hourA), skin.hourDecoration);
+
+ if (skin.minDecoration)
+ this.radialLineAtAngle(this.tickAngle(minA), skin.minDecoration);
+
+ if (this.showSecondHand && skin.secondDecoration)
+ this.radialLineAtAngle(this.tickAngle(secA),skin.secondDecoration);
+ }
},
// Check the time and display the clock
Please sign in to comment.
Something went wrong with that request. Please try again.