Change nested loop and directly change pixels
This commit is contained in:
parent
f829d589d5
commit
7707aca03e
1 changed files with 4 additions and 4 deletions
|
@ -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 a new issue