mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-26 12:35:33 +00:00
Add DocumentApi::clearImage() member function
This commit is contained in:
parent
03ac41e05d
commit
8acfa688cc
@ -1190,6 +1190,16 @@ void DocumentApi::replaceStockImage(Sprite* sprite, int imageIndex, Image* newIm
|
||||
delete oldImage;
|
||||
}
|
||||
|
||||
void DocumentApi::clearImage(Image* image, color_t bgcolor)
|
||||
{
|
||||
if (undoEnabled())
|
||||
m_undoers->pushUndoer(new undoers::ImageArea(getObjects(),
|
||||
image, 0, 0, image->width(), image->height()));
|
||||
|
||||
// clear all
|
||||
clear_image(image, bgcolor);
|
||||
}
|
||||
|
||||
// Clears the mask region in the current sprite with the specified background color.
|
||||
void DocumentApi::clearMask(Layer* layer, Cel* cel, color_t bgcolor)
|
||||
{
|
||||
@ -1207,12 +1217,7 @@ void DocumentApi::clearMask(Layer* layer, Cel* cel, color_t bgcolor)
|
||||
if (!m_document->isMaskVisible()) {
|
||||
// If the layer is the background then we clear the image.
|
||||
if (layer->isBackground()) {
|
||||
if (undoEnabled())
|
||||
m_undoers->pushUndoer(new undoers::ImageArea(getObjects(),
|
||||
image, 0, 0, image->width(), image->height()));
|
||||
|
||||
// clear all
|
||||
clear_image(image, bgcolor);
|
||||
clearImage(image, bgcolor);
|
||||
}
|
||||
// If the layer is transparent we can remove the cel (and its
|
||||
// associated image).
|
||||
|
@ -112,6 +112,7 @@ namespace app {
|
||||
void replaceStockImage(Sprite* sprite, int imageIndex, Image* newImage);
|
||||
|
||||
// Image API
|
||||
void clearImage(Image* image, color_t bgcolor);
|
||||
void clearMask(Layer* layer, Cel* cel, color_t bgcolor);
|
||||
void flipImage(Image* image, const gfx::Rect& bounds, raster::algorithm::FlipType flipType);
|
||||
void flipImageWithMask(Image* image, const Mask* mask, raster::algorithm::FlipType flipType, color_t bgcolor);
|
||||
|
Loading…
x
Reference in New Issue
Block a user