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

Meta+Userland: Pass Gfx::IntSize by value

Just two ints like Gfx::IntPoint.
This commit is contained in:
MacDue 2022-12-06 21:35:32 +00:00 committed by Andreas Kling
parent e011eafd37
commit 27fae78335
63 changed files with 142 additions and 142 deletions

View file

@ -14,7 +14,7 @@ class CreateNewImageDialog final : public GUI::Dialog {
C_OBJECT(CreateNewImageDialog)
public:
Gfx::IntSize const& image_size() const { return m_image_size; }
Gfx::IntSize image_size() const { return m_image_size; }
DeprecatedString const& image_name() const { return m_image_name; }
private:

View file

@ -13,7 +13,7 @@
namespace PixelPaint {
CreateNewLayerDialog::CreateNewLayerDialog(Gfx::IntSize const& suggested_size, GUI::Window* parent_window)
CreateNewLayerDialog::CreateNewLayerDialog(Gfx::IntSize suggested_size, GUI::Window* parent_window)
: Dialog(parent_window)
{
set_title("Create new layer");

View file

@ -14,11 +14,11 @@ class CreateNewLayerDialog final : public GUI::Dialog {
C_OBJECT(CreateNewLayerDialog);
public:
Gfx::IntSize const& layer_size() const { return m_layer_size; }
Gfx::IntSize layer_size() const { return m_layer_size; }
DeprecatedString const& layer_name() const { return m_layer_name; }
private:
CreateNewLayerDialog(Gfx::IntSize const& suggested_size, GUI::Window* parent_window);
CreateNewLayerDialog(Gfx::IntSize suggested_size, GUI::Window* parent_window);
Gfx::IntSize m_layer_size;
DeprecatedString m_layer_name;

View file

@ -24,7 +24,7 @@
namespace PixelPaint {
ErrorOr<NonnullRefPtr<Image>> Image::try_create_with_size(Gfx::IntSize const& size)
ErrorOr<NonnullRefPtr<Image>> Image::try_create_with_size(Gfx::IntSize size)
{
VERIFY(!size.is_empty());
@ -34,7 +34,7 @@ ErrorOr<NonnullRefPtr<Image>> Image::try_create_with_size(Gfx::IntSize const& si
return adopt_nonnull_ref_or_enomem(new (nothrow) Image(size));
}
Image::Image(Gfx::IntSize const& size)
Image::Image(Gfx::IntSize size)
: m_size(size)
, m_selection(*this)
{
@ -548,7 +548,7 @@ Optional<Gfx::IntRect> Image::nonempty_content_bounding_rect() const
return bounding_rect;
}
void Image::resize(Gfx::IntSize const& new_size, Gfx::Painter::ScalingMode scaling_mode)
void Image::resize(Gfx::IntSize new_size, Gfx::Painter::ScalingMode scaling_mode)
{
float scale_x = 1.0f;
float scale_y = 1.0f;

View file

@ -46,7 +46,7 @@ protected:
class Image : public RefCounted<Image> {
public:
static ErrorOr<NonnullRefPtr<Image>> try_create_with_size(Gfx::IntSize const&);
static ErrorOr<NonnullRefPtr<Image>> try_create_with_size(Gfx::IntSize);
static ErrorOr<NonnullRefPtr<Image>> try_create_from_pixel_paint_json(JsonObject const&);
static ErrorOr<NonnullRefPtr<Image>> try_create_from_bitmap(NonnullRefPtr<Gfx::Bitmap>);
@ -63,7 +63,7 @@ public:
Layer const& layer(size_t index) const { return m_layers.at(index); }
Layer& layer(size_t index) { return m_layers.at(index); }
Gfx::IntSize const& size() const { return m_size; }
Gfx::IntSize size() const { return m_size; }
Gfx::IntRect rect() const { return { {}, m_size }; }
void add_layer(NonnullRefPtr<Layer>);
@ -100,14 +100,14 @@ public:
void flip(Gfx::Orientation orientation);
void rotate(Gfx::RotationDirection direction);
void crop(Gfx::IntRect const& rect);
void resize(Gfx::IntSize const& new_size, Gfx::Painter::ScalingMode scaling_mode);
void resize(Gfx::IntSize new_size, Gfx::Painter::ScalingMode scaling_mode);
Optional<Gfx::IntRect> nonempty_content_bounding_rect() const;
Color color_at(Gfx::IntPoint point) const;
private:
explicit Image(Gfx::IntSize const&);
explicit Image(Gfx::IntSize);
void did_change(Gfx::IntRect const& modified_rect = {});
void did_change_rect(Gfx::IntRect const& modified_rect = {});

View file

@ -16,7 +16,7 @@
namespace PixelPaint {
ErrorOr<NonnullRefPtr<Layer>> Layer::try_create_with_size(Image& image, Gfx::IntSize const& size, DeprecatedString name)
ErrorOr<NonnullRefPtr<Layer>> Layer::try_create_with_size(Image& image, Gfx::IntSize size, DeprecatedString name)
{
VERIFY(!size.is_empty());
@ -221,7 +221,7 @@ void Layer::crop(Gfx::IntRect const& rect)
did_modify_bitmap();
}
void Layer::resize(Gfx::IntSize const& new_size, Gfx::IntPoint new_location, Gfx::Painter::ScalingMode scaling_mode)
void Layer::resize(Gfx::IntSize new_size, Gfx::IntPoint new_location, Gfx::Painter::ScalingMode scaling_mode)
{
auto src_rect = Gfx::IntRect(Gfx::IntPoint(0, 0), size());
auto dst_rect = Gfx::IntRect(Gfx::IntPoint(0, 0), new_size);
@ -261,7 +261,7 @@ void Layer::resize(Gfx::IntRect const& new_rect, Gfx::Painter::ScalingMode scali
resize(new_rect.size(), new_rect.location(), scaling_mode);
}
void Layer::resize(Gfx::IntSize const& new_size, Gfx::Painter::ScalingMode scaling_mode)
void Layer::resize(Gfx::IntSize new_size, Gfx::Painter::ScalingMode scaling_mode)
{
resize(new_size, location(), scaling_mode);
}

View file

@ -29,7 +29,7 @@ class Layer
AK_MAKE_NONMOVABLE(Layer);
public:
static ErrorOr<NonnullRefPtr<Layer>> try_create_with_size(Image&, Gfx::IntSize const&, DeprecatedString name);
static ErrorOr<NonnullRefPtr<Layer>> try_create_with_size(Image&, Gfx::IntSize, DeprecatedString name);
static ErrorOr<NonnullRefPtr<Layer>> try_create_with_bitmap(Image&, NonnullRefPtr<Gfx::Bitmap>, DeprecatedString name);
static ErrorOr<NonnullRefPtr<Layer>> try_create_snapshot(Image&, Layer const&);
@ -59,9 +59,9 @@ public:
void flip(Gfx::Orientation orientation);
void rotate(Gfx::RotationDirection direction);
void crop(Gfx::IntRect const& rect);
void resize(Gfx::IntSize const& new_size, Gfx::Painter::ScalingMode scaling_mode);
void resize(Gfx::IntSize new_size, Gfx::Painter::ScalingMode scaling_mode);
void resize(Gfx::IntRect const& new_rect, Gfx::Painter::ScalingMode scaling_mode);
void resize(Gfx::IntSize const& new_size, Gfx::IntPoint new_location, Gfx::Painter::ScalingMode scaling_mode);
void resize(Gfx::IntSize new_size, Gfx::IntPoint new_location, Gfx::Painter::ScalingMode scaling_mode);
Optional<Gfx::IntRect> nonempty_content_bounding_rect() const;

View file

@ -16,7 +16,7 @@
namespace PixelPaint {
ResizeImageDialog::ResizeImageDialog(Gfx::IntSize const& suggested_size, GUI::Window* parent_window)
ResizeImageDialog::ResizeImageDialog(Gfx::IntSize suggested_size, GUI::Window* parent_window)
: Dialog(parent_window)
{
m_desired_size.set_width(max(1, suggested_size.width()));

View file

@ -15,12 +15,12 @@ class ResizeImageDialog final : public GUI::Dialog {
C_OBJECT(ResizeImageDialog);
public:
Gfx::IntSize const& desired_size() const { return m_desired_size; }
Gfx::IntSize desired_size() const { return m_desired_size; }
Gfx::Painter::ScalingMode scaling_mode() const { return m_scaling_mode; }
bool should_rescale() const { return m_rescale_image; }
private:
ResizeImageDialog(Gfx::IntSize const& starting_size, GUI::Window* parent_window);
ResizeImageDialog(Gfx::IntSize starting_size, GUI::Window* parent_window);
Gfx::IntSize m_desired_size;
Gfx::Painter::ScalingMode m_scaling_mode;