fixed background settings not applying ( save )
This commit is contained in:
parent
6a47a2ff9d
commit
eaf4cba87d
@ -31,7 +31,7 @@ window.save = function() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'current color': {
|
case 'current color': {
|
||||||
c.fillStyle = settings.strokeStyle;
|
c.fillStyle = settings.color;
|
||||||
c.globalCompositeOperation = 'destination-over';
|
c.globalCompositeOperation = 'destination-over';
|
||||||
c.fillRect(0, 0, width(), height());
|
c.fillRect(0, 0, width(), height());
|
||||||
c.globalCompositeOperation = settings.composite;
|
c.globalCompositeOperation = settings.composite;
|
||||||
|
@ -16,7 +16,7 @@ function save() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'current color': {
|
case 'current color': {
|
||||||
c.fillStyle = settings.strokeStyle;
|
c.fillStyle = settings.color;
|
||||||
c.globalCompositeOperation = 'destination-over';
|
c.globalCompositeOperation = 'destination-over';
|
||||||
c.fillRect(0, 0, width(), height());
|
c.fillRect(0, 0, width(), height());
|
||||||
c.fillStyle = settings.color;
|
c.fillStyle = settings.color;
|
||||||
|
@ -24,27 +24,19 @@ function save() {
|
|||||||
var cData = c.getImageData(0, 0, width(), height());
|
var cData = c.getImageData(0, 0, width(), height());
|
||||||
switch(save.background) {
|
switch(save.background) {
|
||||||
case 'white': {
|
case 'white': {
|
||||||
var cache = {
|
|
||||||
color: c.color,
|
|
||||||
composite: c.globalCompositeOperation
|
|
||||||
}
|
|
||||||
c.fillStyle = 'white';
|
c.fillStyle = 'white';
|
||||||
c.globalCompositeOperation = 'destination-over';
|
c.globalCompositeOperation = 'destination-over';
|
||||||
c.fillRect(0, 0, width(), height());
|
c.fillRect(0, 0, width(), height());
|
||||||
c.fillStyle = cache.fillStyle;
|
c.fillStyle = settings.color;
|
||||||
c.globalCompositeOperation = cache.composite;
|
c.globalCompositeOperation = settings.composite;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'current color': {
|
case 'current color': {
|
||||||
var cache = {
|
c.fillStyle = settings.color;
|
||||||
fillStyle: c.color,
|
|
||||||
composite: c.globalCompositeOperation
|
|
||||||
}
|
|
||||||
c.fillStyle = settings.strokeStyle;
|
|
||||||
c.globalCompositeOperation = 'destination-over';
|
c.globalCompositeOperation = 'destination-over';
|
||||||
c.fillRect(0, 0, width(), height());
|
c.fillRect(0, 0, width(), height());
|
||||||
c.fillStyle = cache.fillStyle;
|
c.fillStyle = settings.color;
|
||||||
c.globalCompositeOperation = cache.composite;
|
c.globalCompositeOperation = settings.composite;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user