From 9557b9a61f98d106391834e418ad9cc3b141b675 Mon Sep 17 00:00:00 2001 From: darul Date: Tue, 14 Jan 2014 20:42:10 +0100 Subject: [PATCH 1/2] land border shadow option --- src/plugins.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins.js b/src/plugins.js index df55f64..77d0e48 100644 --- a/src/plugins.js +++ b/src/plugins.js @@ -46,6 +46,12 @@ planet.onDraw(function() { planet.withSavedContext(function(context) { context.beginPath(); + // nice land shadow + if (config.shadow) { + context.shadowOffsetX = config.shadow.shadowOffsetX || 1; + context.shadowOffsetY = config.shadow.shadowOffsetY || 1; + context.shadowColor = config.shadow.shadowColor || 'white'; + } planet.path.context(context)(land); if (config.fill !== false) { From 8dd819ddb2aaed90307d63342562c839e0d5823d Mon Sep 17 00:00:00 2001 From: darul Date: Tue, 14 Jan 2014 21:08:40 +0100 Subject: [PATCH 2/2] refactoring --- src/plugins.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins.js b/src/plugins.js index 77d0e48..df15753 100644 --- a/src/plugins.js +++ b/src/plugins.js @@ -45,14 +45,14 @@ planet.onDraw(function() { planet.withSavedContext(function(context) { - context.beginPath(); - // nice land shadow + context.beginPath(); + planet.path.context(context)(land); + if (config.shadow) { context.shadowOffsetX = config.shadow.shadowOffsetX || 1; context.shadowOffsetY = config.shadow.shadowOffsetY || 1; context.shadowColor = config.shadow.shadowColor || 'white'; - } - planet.path.context(context)(land); + } if (config.fill !== false) { context.fillStyle = config.fill || 'white';