From eaf4cba87d185382cafba7f93c0b219c9a30642f Mon Sep 17 00:00:00 2001 From: Mahdi Dibaiee Date: Fri, 7 Feb 2014 17:52:26 +0330 Subject: [PATCH] fixed background settings not applying ( save ) --- Mobile/js/mobile.js | 2 +- Web/js/desktop.js | 2 +- Web/js/mobile.js | 18 +++++------------- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/Mobile/js/mobile.js b/Mobile/js/mobile.js index dc3f3a1..84f1702 100644 --- a/Mobile/js/mobile.js +++ b/Mobile/js/mobile.js @@ -31,7 +31,7 @@ window.save = function() { break; } case 'current color': { - c.fillStyle = settings.strokeStyle; + c.fillStyle = settings.color; c.globalCompositeOperation = 'destination-over'; c.fillRect(0, 0, width(), height()); c.globalCompositeOperation = settings.composite; diff --git a/Web/js/desktop.js b/Web/js/desktop.js index c9fe5aa..205fc3d 100644 --- a/Web/js/desktop.js +++ b/Web/js/desktop.js @@ -16,7 +16,7 @@ function save() { break; } case 'current color': { - c.fillStyle = settings.strokeStyle; + c.fillStyle = settings.color; c.globalCompositeOperation = 'destination-over'; c.fillRect(0, 0, width(), height()); c.fillStyle = settings.color; diff --git a/Web/js/mobile.js b/Web/js/mobile.js index dcb0fa5..8b07849 100644 --- a/Web/js/mobile.js +++ b/Web/js/mobile.js @@ -24,27 +24,19 @@ function save() { var cData = c.getImageData(0, 0, width(), height()); switch(save.background) { case 'white': { - var cache = { - color: c.color, - composite: c.globalCompositeOperation - } c.fillStyle = 'white'; c.globalCompositeOperation = 'destination-over'; c.fillRect(0, 0, width(), height()); - c.fillStyle = cache.fillStyle; - c.globalCompositeOperation = cache.composite; + c.fillStyle = settings.color; + c.globalCompositeOperation = settings.composite; break; } case 'current color': { - var cache = { - fillStyle: c.color, - composite: c.globalCompositeOperation - } - c.fillStyle = settings.strokeStyle; + c.fillStyle = settings.color; c.globalCompositeOperation = 'destination-over'; c.fillRect(0, 0, width(), height()); - c.fillStyle = cache.fillStyle; - c.globalCompositeOperation = cache.composite; + c.fillStyle = settings.color; + c.globalCompositeOperation = settings.composite; break; } }