mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-03 23:41:56 +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* srcLayer, frame_t srcFrame,
|
||||||
LayerImage* dstLayer, frame_t dstFrame)
|
LayerImage* dstLayer, frame_t dstFrame)
|
||||||
{
|
{
|
||||||
|
ASSERT(srcLayer != dstLayer || srcFrame != dstFrame);
|
||||||
m_transaction.execute(new cmd::MoveCel(
|
m_transaction.execute(new cmd::MoveCel(
|
||||||
srcLayer, srcFrame,
|
srcLayer, srcFrame,
|
||||||
dstLayer, dstFrame));
|
dstLayer, dstFrame));
|
||||||
@ -357,6 +358,7 @@ void DocumentApi::copyCel(
|
|||||||
LayerImage* srcLayer, frame_t srcFrame,
|
LayerImage* srcLayer, frame_t srcFrame,
|
||||||
LayerImage* dstLayer, frame_t dstFrame)
|
LayerImage* dstLayer, frame_t dstFrame)
|
||||||
{
|
{
|
||||||
|
ASSERT(srcLayer != dstLayer || srcFrame != dstFrame);
|
||||||
m_transaction.execute(new cmd::CopyCel(
|
m_transaction.execute(new cmd::CopyCel(
|
||||||
srcLayer, srcFrame,
|
srcLayer, srcFrame,
|
||||||
dstLayer, dstFrame));
|
dstLayer, dstFrame));
|
||||||
@ -365,6 +367,8 @@ void DocumentApi::copyCel(
|
|||||||
void DocumentApi::swapCel(
|
void DocumentApi::swapCel(
|
||||||
LayerImage* layer, frame_t frame1, frame_t frame2)
|
LayerImage* layer, frame_t frame1, frame_t frame2)
|
||||||
{
|
{
|
||||||
|
ASSERT(frame1 != frame2);
|
||||||
|
|
||||||
Sprite* sprite = layer->sprite();
|
Sprite* sprite = layer->sprite();
|
||||||
ASSERT(sprite != NULL);
|
ASSERT(sprite != NULL);
|
||||||
ASSERT(frame1 >= 0 && frame1 < sprite->totalFrames());
|
ASSERT(frame1 >= 0 && frame1 < sprite->totalFrames());
|
||||||
|
Loading…
Reference in New Issue
Block a user