Skip to content

Commit

Permalink
Change argument type for layer bitmap/vector
Browse files Browse the repository at this point in the history
  • Loading branch information
MrStevns committed Apr 10, 2024
1 parent 5cdf342 commit b00d582
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
5 changes: 2 additions & 3 deletions core_lib/src/structure/layerbitmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,11 @@ void LayerBitmap::replaceLastBitmapAtFrame(const BitmapImage* replaceWithImage)
*static_cast<BitmapImage*>(getLastKeyFrameAtPosition(replaceWithImage->pos())) = *replaceWithImage;
}

void LayerBitmap::putBitmapIntoFrame(KeyFrame* keyframe, int frameIndex)
void LayerBitmap::putBitmapIntoFrame(BitmapImage* bitmapImage, int frameIndex)
{
BitmapImage* currentBitmap = getBitmapImageAtFrame(frameIndex);

BitmapImage newBitmap = *static_cast<BitmapImage*>(keyframe);
static_cast<BitmapImage*>(currentBitmap)->paste(&newBitmap);
static_cast<BitmapImage*>(currentBitmap)->paste(bitmapImage);
}

void LayerBitmap::repositionFrame(QPoint point, int frame)
Expand Down
2 changes: 1 addition & 1 deletion core_lib/src/structure/layerbitmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class LayerBitmap : public Layer
BitmapImage* getBitmapImageAtFrame(int frameNumber);
BitmapImage* getLastBitmapImageAtFrame(int frameNumber, int increment = 0);
void replaceLastBitmapAtFrame(const BitmapImage* replaceWithImage);
void putBitmapIntoFrame(KeyFrame* keyframe, int frameIndex);
void putBitmapIntoFrame(BitmapImage* bitmapImage, int frameIndex);

void repositionFrame(QPoint point, int frame);
QRect getFrameBounds(int frame);
Expand Down
6 changes: 2 additions & 4 deletions core_lib/src/structure/layervector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,9 @@ void LayerVector::replaceLastVectorImageAtFrame(const VectorImage* replaceWithIm
*static_cast<VectorImage*>(getLastKeyFrameAtPosition(replaceWithImage->pos())) = *replaceWithImage;
}

void LayerVector::putVectorImageIntoFrame(VectorImage* keyframe, int frameIndex)
void LayerVector::putVectorImageIntoFrame(VectorImage* vectorImage, int frameIndex)
{
VectorImage* currentVectorImg = getVectorImageAtFrame(frameIndex);

VectorImage newVectorImg = *static_cast<VectorImage*>(keyframe);
static_cast<VectorImage*>(currentVectorImg)->paste(newVectorImg);
static_cast<VectorImage*>(currentVectorImg)->paste(vectorImage);
}

2 changes: 1 addition & 1 deletion core_lib/src/structure/layervector.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class LayerVector : public Layer
VectorImage* getVectorImageAtFrame(int frameNumber) const;
VectorImage* getLastVectorImageAtFrame(int frameNumber, int increment) const;
void replaceLastVectorImageAtFrame(const VectorImage* replaceWithImage);
void putVectorImageIntoFrame(VectorImage* keyframe, int frameIndex);
void putVectorImageIntoFrame(VectorImage* vectorImage, int frameIndex);

bool usesColor(int index);
void removeColor(int index);
Expand Down

0 comments on commit b00d582

Please sign in to comment.