1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:57:45 +00:00

PixelPaint: Add Image>Resize Image... dialog. (Front end)

This commit is contained in:
Andrew Smith 2022-03-08 06:00:04 -06:00 committed by Andreas Kling
parent abaecb878b
commit 02399d4775
11 changed files with 302 additions and 0 deletions

View file

@ -527,6 +527,17 @@ void Image::crop(Gfx::IntRect const& cropped_rect)
did_change_rect(cropped_rect);
}
void Image::resize(Gfx::IntSize const& new_size, Gfx::Painter::ScalingMode scaling_mode)
{
for (auto& layer : m_layers) {
layer.resize(new_size, scaling_mode);
}
m_size = { new_size.width(), new_size.height() };
did_change_rect();
}
Color Image::color_at(Gfx::IntPoint const& point) const
{
Color color;