mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Change nested loop and directly change pixels
This commit is contained in:
parent
f829d589d5
commit
7707aca03e
@ -121,11 +121,11 @@
|
||||
|
||||
mergeFrames_ : function (frameA, frameB) {
|
||||
var transparentColorInt = pskl.utils.colorToInt(Constants.TRANSPARENT_COLOR);
|
||||
frameB.forEachPixel(function (color, col, row) {
|
||||
if (color != transparentColorInt) {
|
||||
frameA.setPixel(col, row, color);
|
||||
for (var i = 0, length = frameA.getWidth() * frameA.getHeight(); i < length; ++i) {
|
||||
if (frameB.pixels[i] != transparentColorInt && frameA.pixels[i] != frameB.pixels[i]) {
|
||||
frameA.pixels[i] = frameB.pixels[i];
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
resize : function (frame, targetWidth, targetHeight, smoothing) {
|
||||
|
Loading…
Reference in New Issue
Block a user