mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-16 05:42:32 +00:00
Replace new/delete with UniquePtr in MovingPixelsState() ctor.
This commit is contained in:
parent
344d0d5ea0
commit
34a5ff5dc3
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include "app.h"
|
#include "app.h"
|
||||||
#include "app/color_utils.h"
|
#include "app/color_utils.h"
|
||||||
|
#include "base/unique_ptr.h"
|
||||||
#include "gfx/rect.h"
|
#include "gfx/rect.h"
|
||||||
#include "gui/message.h"
|
#include "gui/message.h"
|
||||||
#include "gui/system.h"
|
#include "gui/system.h"
|
||||||
@ -47,11 +48,12 @@ MovingPixelsState::MovingPixelsState(Editor* editor, Message* msg, Image* imge,
|
|||||||
// Copy the mask to the extra cel image
|
// Copy the mask to the extra cel image
|
||||||
Document* document = editor->getDocument();
|
Document* document = editor->getDocument();
|
||||||
Sprite* sprite = editor->getSprite();
|
Sprite* sprite = editor->getSprite();
|
||||||
Image* tmpImage = NewImageFromMask(document);
|
{
|
||||||
x = document->getMask()->x;
|
UniquePtr<Image> tmpImage(NewImageFromMask(document));
|
||||||
y = document->getMask()->y;
|
x = document->getMask()->x;
|
||||||
m_pixelsMovement = new PixelsMovement(document, sprite, tmpImage, x, y, opacity);
|
y = document->getMask()->y;
|
||||||
delete tmpImage;
|
m_pixelsMovement = new PixelsMovement(document, sprite, tmpImage, x, y, opacity);
|
||||||
|
}
|
||||||
|
|
||||||
// If the Ctrl key is pressed start dragging a copy of the selection
|
// If the Ctrl key is pressed start dragging a copy of the selection
|
||||||
if (customization && customization->isCopySelectionKeyPressed())
|
if (customization && customization->isCopySelectionKeyPressed())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user