From 1ae052fa11bd2cb2fb7ce064c53c1a2c1ac33f77 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 11 Dec 2010 16:16:52 -0500 Subject: [PATCH] Work around a WebKit bug in which the same path cannot be used to storke and fill. --- RGB Converter.wdgt/Widget.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/RGB Converter.wdgt/Widget.js b/RGB Converter.wdgt/Widget.js index 1fef885..ae33454 100644 --- a/RGB Converter.wdgt/Widget.js +++ b/RGB Converter.wdgt/Widget.js @@ -157,14 +157,23 @@ function Draw() context.fill(); context.closePath(); - // Draw the inner wheel. + // Draw the inner wheel. WebKit in 10.6.5 (and maybe earlier) has a bug in + // which you can't fill a path after stroking it, or vice versa. + var _arc = function(c) { + c.arc(center[0], center[1], canvas.width / 4.75, 0, Math.PI * 2, true); + } + context.save(); + context.beginPath(); + _arc(context) + context.strokeStyle = 'rgb(30,30,30)'; + context.stroke(); + context.beginPath(); - context.arc(center[0], center[1], canvas.width / 4.75, 0, Math.PI * 2, true); + _arc(context); context.fillStyle = _GetRGBColorString(); context.fill(); - context.strokeStyle = 'black'; - context.stroke(); context.closePath(); + delete _arc; } // ################################################################### -- 2.43.5