mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-01 09:04:02 +00:00
Add some asserts in DocumentApi::move/copy/swapCel() member functions
This commit is contained in:
parent
e76d25283a
commit
55477ce0d5
@ -348,6 +348,7 @@ void DocumentApi::moveCel(
|
||||
LayerImage* srcLayer, frame_t srcFrame,
|
||||
LayerImage* dstLayer, frame_t dstFrame)
|
||||
{
|
||||
ASSERT(srcLayer != dstLayer || srcFrame != dstFrame);
|
||||
m_transaction.execute(new cmd::MoveCel(
|
||||
srcLayer, srcFrame,
|
||||
dstLayer, dstFrame));
|
||||
@ -357,6 +358,7 @@ void DocumentApi::copyCel(
|
||||
LayerImage* srcLayer, frame_t srcFrame,
|
||||
LayerImage* dstLayer, frame_t dstFrame)
|
||||
{
|
||||
ASSERT(srcLayer != dstLayer || srcFrame != dstFrame);
|
||||
m_transaction.execute(new cmd::CopyCel(
|
||||
srcLayer, srcFrame,
|
||||
dstLayer, dstFrame));
|
||||
@ -365,6 +367,8 @@ void DocumentApi::copyCel(
|
||||
void DocumentApi::swapCel(
|
||||
LayerImage* layer, frame_t frame1, frame_t frame2)
|
||||
{
|
||||
ASSERT(frame1 != frame2);
|
||||
|
||||
Sprite* sprite = layer->sprite();
|
||||
ASSERT(sprite != NULL);
|
||||
ASSERT(frame1 >= 0 && frame1 < sprite->totalFrames());
|
||||
|
Loading…
Reference in New Issue
Block a user