fixed background settings not applying ( save )

This commit is contained in:
Mahdi Dibaiee
2014-02-07 17:47:17 +03:30
parent dac9aaada9
commit 6a47a2ff9d
6 changed files with 21 additions and 49 deletions

View File

@ -23,27 +23,18 @@ $('a[href^="http"]').on('tap', function(e) {
window.save = function() {
switch(save.background) {
case 'white': {
var cache = {
fillStyle: 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.globalCompositeOperation = 'destination-over';
c.fillRect(0, 0, width(), height());
c.fillStyle = cache.fillStyle;
c.globalCompositeOperation = cache.composite;
c.globalCompositeOperation = settings.composite;
break;
}
}