mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-06 12:39:57 +00:00
Fix PixelsMovementImpl with ExpandCelCanvas to support moving the pixels outside the cel bounds
(but inside visible portions of sprite).
This commit is contained in:
parent
b9b93e6869
commit
2e379c244f
@ -27,6 +27,7 @@
|
|||||||
#include "raster/mask.h"
|
#include "raster/mask.h"
|
||||||
#include "raster/sprite.h"
|
#include "raster/sprite.h"
|
||||||
#include "undo_transaction.h"
|
#include "undo_transaction.h"
|
||||||
|
#include "util/expand_cel_canvas.h"
|
||||||
#include "widgets/editor/pixels_movement.h"
|
#include "widgets/editor/pixels_movement.h"
|
||||||
|
|
||||||
using namespace gfx;
|
using namespace gfx;
|
||||||
@ -177,7 +178,19 @@ public:
|
|||||||
|
|
||||||
{
|
{
|
||||||
DocumentWriter documentWriter(m_documentReader);
|
DocumentWriter documentWriter(m_documentReader);
|
||||||
m_undoTransaction.pasteImage(image, cel->getX(), cel->getY(), cel->getOpacity());
|
{
|
||||||
|
// Expand the canvas to paste the image in the fully visible
|
||||||
|
// portion of sprite.
|
||||||
|
ExpandCelCanvas expandCelCanvas(documentWriter, m_sprite,
|
||||||
|
m_sprite->getCurrentLayer(), TILED_NONE);
|
||||||
|
|
||||||
|
image_merge(expandCelCanvas.getDestCanvas(), image,
|
||||||
|
cel->getX()-expandCelCanvas.getCel()->getX(),
|
||||||
|
cel->getY()-expandCelCanvas.getCel()->getY(),
|
||||||
|
cel->getOpacity(), BLEND_MODE_NORMAL);
|
||||||
|
|
||||||
|
expandCelCanvas.commit();
|
||||||
|
}
|
||||||
m_undoTransaction.commit();
|
m_undoTransaction.commit();
|
||||||
|
|
||||||
documentWriter->destroyExtraCel();
|
documentWriter->destroyExtraCel();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user