CoolClock
CoolClock copied to clipboard
Initial rendering of hands doesn't get cleared (Android, Jelly Bean, WebView)
Hi,
on Android 4.1, when a clock is displayed in a webview, I do get two renderings of each hand, where one of them is always on the same initial spot. So I get a normal running clock, and a frozen initial one.
Any idea on what could be causing this?
No idea.
It's odd. Replacing
this.ctx.clearRect(0, 0, this.renderRadius * 2,this.renderRadius * 2);
with
this.canvas.width = this.renderRadius * 2; this.canvas.height = this.renderRadius * 2;
fixes that issue, but creates some sort of scaling issue. I believe that the lines look a bit thicker, but there's something with antialiasing which jumps right into the eye. It's as if scaling gets applied after antialiasing, thus making it all look blurry like when you scale up an antialiased image in an image editor. It doesn't look that fine anymore. I'll look into it, specially at the this.ctx.scale(this.scale,this.scale); call in init.