mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:17:36 +00:00
PixelPaint: Add actions to flip image vertically/horizontally
This commit is contained in:
parent
0c56f06994
commit
6a8c408856
3 changed files with 33 additions and 0 deletions
|
@ -573,4 +573,16 @@ void Image::set_path(String path)
|
|||
set_title(LexicalPath::basename(m_path));
|
||||
}
|
||||
|
||||
void Image::flip(Gfx::Orientation orientation)
|
||||
{
|
||||
for (auto& layer : m_layers) {
|
||||
auto flipped = layer.bitmap().flipped(orientation);
|
||||
VERIFY(flipped);
|
||||
layer.set_bitmap(*flipped);
|
||||
layer.did_modify_bitmap(rect());
|
||||
}
|
||||
|
||||
did_change();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue