mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Fix image dropper when image has to be moved
This commit is contained in:
parent
03f37d46ac
commit
bf91c4ef62
@ -67,12 +67,10 @@
|
|||||||
var droppedFrame = pskl.utils.FrameUtils.createFromImage(this.importedImage_);
|
var droppedFrame = pskl.utils.FrameUtils.createFromImage(this.importedImage_);
|
||||||
var currentFrame = this.piskelController.getCurrentFrame();
|
var currentFrame = this.piskelController.getCurrentFrame();
|
||||||
|
|
||||||
var dropCoordinates = this.adjustDropPosition_(this.dropPosition_, droppedFrame);
|
var origin = this.adjustDropPosition_(this.dropPosition_, droppedFrame);
|
||||||
|
droppedFrame.forEachPixel(function (color, x, y) {
|
||||||
currentFrame.forEachPixel(function (color, x, y) {
|
if (color != pskl.utils.colorToInt(Constants.TRANSPARENT_COLOR)) {
|
||||||
var fColor = droppedFrame.getPixel(x - dropCoordinates.x, y - dropCoordinates.y);
|
currentFrame.setPixel(origin.x + x, origin.y + y, color);
|
||||||
if (fColor && fColor != Constants.TRANSPARENT_COLOR) {
|
|
||||||
currentFrame.setPixel(x, y, fColor);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user