CoolClock icon indicating copy to clipboard operation
CoolClock copied to clipboard

Initial rendering of hands doesn't get cleared (Android, Jelly Bean, WebView)

Open danielfaust opened this issue 11 years ago • 2 comments

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?

danielfaust avatar Oct 16 '12 23:10 danielfaust

No idea.

simonbaird avatar Oct 17 '12 04:10 simonbaird

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.

danielfaust avatar Oct 17 '12 12:10 danielfaust