mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 14:47:34 +00:00
Meta+Userland: Pass Gfx::IntPoint by value
This is just two ints or 8 bytes or the size of the reference on x86_64 or AArch64.
This commit is contained in:
parent
bbc149ebb9
commit
7be0b27dd3
161 changed files with 442 additions and 441 deletions
|
@ -690,7 +690,7 @@ void BrowserWindow::config_bool_did_change(DeprecatedString const& domain, Depre
|
|||
// NOTE: CloseDownloadWidgetOnFinish is read each time in DownloadWindow
|
||||
}
|
||||
|
||||
void BrowserWindow::broadcast_window_position(Gfx::IntPoint const& position)
|
||||
void BrowserWindow::broadcast_window_position(Gfx::IntPoint position)
|
||||
{
|
||||
tab_widget().for_each_child_of_type<Browser::Tab>([&](auto& tab) {
|
||||
tab.window_position_changed(position);
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
void content_filters_changed();
|
||||
void proxy_mappings_changed();
|
||||
|
||||
void broadcast_window_position(Gfx::IntPoint const&);
|
||||
void broadcast_window_position(Gfx::IntPoint);
|
||||
void broadcast_window_size(Gfx::IntSize const&);
|
||||
|
||||
private:
|
||||
|
|
|
@ -272,7 +272,7 @@ Tab::Tab(BrowserWindow& window)
|
|||
m_web_content_view->set_system_visibility_state(true);
|
||||
};
|
||||
|
||||
view().on_reposition_window = [this](Gfx::IntPoint const& position) {
|
||||
view().on_reposition_window = [this](Gfx::IntPoint position) {
|
||||
this->window().move_to(position);
|
||||
return this->window().position();
|
||||
};
|
||||
|
@ -318,7 +318,7 @@ Tab::Tab(BrowserWindow& window)
|
|||
m_link_context_menu->add_separator();
|
||||
m_link_context_menu->add_action(window.inspect_dom_node_action());
|
||||
|
||||
view().on_link_context_menu_request = [this](auto& url, auto& screen_position) {
|
||||
view().on_link_context_menu_request = [this](auto& url, auto screen_position) {
|
||||
m_link_context_menu_url = url;
|
||||
m_link_context_menu->popup(screen_position, m_link_context_menu_default_action);
|
||||
};
|
||||
|
@ -345,7 +345,7 @@ Tab::Tab(BrowserWindow& window)
|
|||
m_image_context_menu->add_separator();
|
||||
m_image_context_menu->add_action(window.inspect_dom_node_action());
|
||||
|
||||
view().on_image_context_menu_request = [this](auto& image_url, auto& screen_position, Gfx::ShareableBitmap const& shareable_bitmap) {
|
||||
view().on_image_context_menu_request = [this](auto& image_url, auto screen_position, Gfx::ShareableBitmap const& shareable_bitmap) {
|
||||
m_image_context_menu_url = image_url;
|
||||
m_image_context_menu_bitmap = shareable_bitmap;
|
||||
m_image_context_menu->popup(screen_position);
|
||||
|
@ -473,7 +473,7 @@ Tab::Tab(BrowserWindow& window)
|
|||
m_page_context_menu->add_separator();
|
||||
m_page_context_menu->add_action(window.take_visible_screenshot_action());
|
||||
m_page_context_menu->add_action(window.take_full_screenshot_action());
|
||||
view().on_context_menu_request = [&](auto& screen_position) {
|
||||
view().on_context_menu_request = [&](auto screen_position) {
|
||||
m_page_context_menu->popup(screen_position);
|
||||
};
|
||||
}
|
||||
|
@ -586,7 +586,7 @@ void Tab::did_become_active()
|
|||
update_actions();
|
||||
}
|
||||
|
||||
void Tab::context_menu_requested(Gfx::IntPoint const& screen_position)
|
||||
void Tab::context_menu_requested(Gfx::IntPoint screen_position)
|
||||
{
|
||||
m_tab_context_menu->popup(screen_position);
|
||||
}
|
||||
|
@ -614,7 +614,7 @@ void Tab::action_left(GUI::Action&)
|
|||
m_statusbar->set_override_text({});
|
||||
}
|
||||
|
||||
void Tab::window_position_changed(Gfx::IntPoint const& position)
|
||||
void Tab::window_position_changed(Gfx::IntPoint position)
|
||||
{
|
||||
m_web_content_view->set_window_position(position);
|
||||
}
|
||||
|
|
|
@ -49,14 +49,14 @@ public:
|
|||
void go_forward(int steps = 1);
|
||||
|
||||
void did_become_active();
|
||||
void context_menu_requested(Gfx::IntPoint const& screen_position);
|
||||
void context_menu_requested(Gfx::IntPoint screen_position);
|
||||
void content_filters_changed();
|
||||
void proxy_mappings_changed();
|
||||
|
||||
void action_entered(GUI::Action&);
|
||||
void action_left(GUI::Action&);
|
||||
|
||||
void window_position_changed(Gfx::IntPoint const&);
|
||||
void window_position_changed(Gfx::IntPoint);
|
||||
void window_size_changed(Gfx::IntSize const&);
|
||||
|
||||
Function<void(DeprecatedString const&)> on_title_change;
|
||||
|
|
|
@ -125,7 +125,7 @@ MainWidget::MainWidget()
|
|||
open_external(url);
|
||||
}
|
||||
};
|
||||
m_web_view->on_context_menu_request = [this](auto& screen_position) {
|
||||
m_web_view->on_context_menu_request = [this](auto screen_position) {
|
||||
m_copy_action->set_enabled(!m_web_view->selected_text().is_empty());
|
||||
m_context_menu->popup(screen_position);
|
||||
};
|
||||
|
|
|
@ -71,7 +71,7 @@ MailWidget::MailWidget()
|
|||
GUI::Clipboard::the().set_plain_text(m_link_context_menu_url.to_deprecated_string());
|
||||
}));
|
||||
|
||||
m_web_view->on_link_context_menu_request = [this](auto& url, auto& screen_position) {
|
||||
m_web_view->on_link_context_menu_request = [this](auto& url, auto screen_position) {
|
||||
m_link_context_menu_url = url;
|
||||
m_link_context_menu->popup(screen_position, m_link_context_menu_default_action);
|
||||
};
|
||||
|
@ -89,7 +89,7 @@ MailWidget::MailWidget()
|
|||
m_web_view->on_link_click(m_image_context_menu_url, "", 0);
|
||||
}));
|
||||
|
||||
m_web_view->on_image_context_menu_request = [this](auto& image_url, auto& screen_position, Gfx::ShareableBitmap const& shareable_bitmap) {
|
||||
m_web_view->on_image_context_menu_request = [this](auto& image_url, auto screen_position, Gfx::ShareableBitmap const& shareable_bitmap) {
|
||||
m_image_context_menu_url = image_url;
|
||||
m_image_context_menu_bitmap = shareable_bitmap;
|
||||
m_image_context_menu->popup(screen_position);
|
||||
|
|
|
@ -214,7 +214,7 @@ static inline int note_from_white_keys(int white_keys)
|
|||
return note;
|
||||
}
|
||||
|
||||
int KeysWidget::note_for_event_position(Gfx::IntPoint const& a_point) const
|
||||
int KeysWidget::note_for_event_position(Gfx::IntPoint a_point) const
|
||||
{
|
||||
if (!frame_inner_rect().contains(a_point))
|
||||
return -1;
|
||||
|
|
|
@ -31,7 +31,7 @@ private:
|
|||
virtual void mouseup_event(GUI::MouseEvent&) override;
|
||||
virtual void mousemove_event(GUI::MouseEvent&) override;
|
||||
|
||||
int note_for_event_position(Gfx::IntPoint const&) const;
|
||||
int note_for_event_position(Gfx::IntPoint) const;
|
||||
|
||||
void set_key(i8 key, DSP::Keyboard::Switch);
|
||||
|
||||
|
|
|
@ -570,7 +570,7 @@ void Image::resize(Gfx::IntSize const& new_size, Gfx::Painter::ScalingMode scali
|
|||
did_change_rect();
|
||||
}
|
||||
|
||||
Color Image::color_at(Gfx::IntPoint const& point) const
|
||||
Color Image::color_at(Gfx::IntPoint point) const
|
||||
{
|
||||
Color color;
|
||||
for (auto& layer : m_layers) {
|
||||
|
|
|
@ -104,7 +104,7 @@ public:
|
|||
|
||||
Optional<Gfx::IntRect> nonempty_content_bounding_rect() const;
|
||||
|
||||
Color color_at(Gfx::IntPoint const& point) const;
|
||||
Color color_at(Gfx::IntPoint point) const;
|
||||
|
||||
private:
|
||||
explicit Image(Gfx::IntSize const&);
|
||||
|
|
|
@ -609,7 +609,7 @@ void ImageEditor::set_secondary_color(Color color)
|
|||
on_secondary_color_change(color);
|
||||
}
|
||||
|
||||
Layer* ImageEditor::layer_at_editor_position(Gfx::IntPoint const& editor_position)
|
||||
Layer* ImageEditor::layer_at_editor_position(Gfx::IntPoint editor_position)
|
||||
{
|
||||
auto image_position = frame_to_content_position(editor_position);
|
||||
for (ssize_t i = m_image->layer_count() - 1; i >= 0; --i) {
|
||||
|
|
|
@ -64,7 +64,7 @@ public:
|
|||
|
||||
void layers_did_change();
|
||||
|
||||
Layer* layer_at_editor_position(Gfx::IntPoint const&);
|
||||
Layer* layer_at_editor_position(Gfx::IntPoint);
|
||||
|
||||
void fit_image_to_view(FitType type = FitType::Both);
|
||||
|
||||
|
@ -84,7 +84,7 @@ public:
|
|||
|
||||
Function<void(DeprecatedString const&)> on_title_change;
|
||||
|
||||
Function<void(Gfx::IntPoint const&)> on_image_mouse_position_change;
|
||||
Function<void(Gfx::IntPoint)> on_image_mouse_position_change;
|
||||
|
||||
Function<void(void)> on_leave;
|
||||
Function<void(bool modified)> on_modified_change;
|
||||
|
|
|
@ -221,7 +221,7 @@ void Layer::crop(Gfx::IntRect const& rect)
|
|||
did_modify_bitmap();
|
||||
}
|
||||
|
||||
void Layer::resize(Gfx::IntSize const& new_size, Gfx::IntPoint const& new_location, Gfx::Painter::ScalingMode scaling_mode)
|
||||
void Layer::resize(Gfx::IntSize const& 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);
|
||||
|
|
|
@ -35,8 +35,8 @@ public:
|
|||
|
||||
~Layer() = default;
|
||||
|
||||
Gfx::IntPoint const& location() const { return m_location; }
|
||||
void set_location(Gfx::IntPoint const& location) { m_location = location; }
|
||||
Gfx::IntPoint location() const { return m_location; }
|
||||
void set_location(Gfx::IntPoint location) { m_location = location; }
|
||||
|
||||
Gfx::Bitmap const& display_bitmap() const { return m_cached_display_bitmap; }
|
||||
Gfx::Bitmap const& content_bitmap() const { return m_content_bitmap; }
|
||||
|
@ -61,7 +61,7 @@ public:
|
|||
void crop(Gfx::IntRect const& rect);
|
||||
void resize(Gfx::IntSize const& 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 const& new_location, Gfx::Painter::ScalingMode scaling_mode);
|
||||
void resize(Gfx::IntSize const& new_size, Gfx::IntPoint new_location, Gfx::Painter::ScalingMode scaling_mode);
|
||||
|
||||
Optional<Gfx::IntRect> nonempty_content_bounding_rect() const;
|
||||
|
||||
|
|
|
@ -186,7 +186,7 @@ void LayerListWidget::paint_event(GUI::PaintEvent& event)
|
|||
Gfx::StylePainter::paint_frame(painter, rect(), palette(), Gfx::FrameShape::Box, Gfx::FrameShadow::Sunken, 2);
|
||||
}
|
||||
|
||||
Optional<size_t> LayerListWidget::gadget_at(Gfx::IntPoint const& position)
|
||||
Optional<size_t> LayerListWidget::gadget_at(Gfx::IntPoint position)
|
||||
{
|
||||
for (size_t i = 0; i < m_gadgets.size(); ++i) {
|
||||
if (m_gadgets[i].rect.contains(position))
|
||||
|
|
|
@ -63,7 +63,7 @@ private:
|
|||
void get_gadget_rects(Gadget const& gadget, bool is_masked, Gfx::IntRect& outer_rect, Gfx::IntRect& outer_thumbnail_rect, Gfx::IntRect& inner_thumbnail_rect, Gfx::IntRect& outer_mask_thumbnail_rect, Gfx::IntRect& inner_mask_thumbnail_rect, Gfx::IntRect& text_rect);
|
||||
bool is_moving_gadget() const { return m_moving_gadget_index.has_value(); }
|
||||
|
||||
Optional<size_t> gadget_at(Gfx::IntPoint const&);
|
||||
Optional<size_t> gadget_at(Gfx::IntPoint);
|
||||
|
||||
size_t to_layer_index(size_t gadget_index) const;
|
||||
size_t to_gadget_index(size_t layer_index) const;
|
||||
|
|
|
@ -44,10 +44,10 @@ public:
|
|||
Gfx::IntRect bounding_rect() const { return m_mask.bounding_rect(); }
|
||||
|
||||
[[nodiscard]] bool is_selected(int x, int y) const { return m_mask.get(x, y) > 0; }
|
||||
[[nodiscard]] bool is_selected(Gfx::IntPoint const& point) const { return is_selected(point.x(), point.y()); }
|
||||
[[nodiscard]] bool is_selected(Gfx::IntPoint point) const { return is_selected(point.x(), point.y()); }
|
||||
|
||||
[[nodiscard]] u8 get_selection_alpha(int x, int y) const { return m_mask.get(x, y); }
|
||||
[[nodiscard]] u8 get_selection_alpha(Gfx::IntPoint const& point) const { return get_selection_alpha(point.x(), point.y()); }
|
||||
[[nodiscard]] u8 get_selection_alpha(Gfx::IntPoint point) const { return get_selection_alpha(point.x(), point.y()); }
|
||||
|
||||
Mask const& mask() const { return m_mask; }
|
||||
void set_mask(Mask);
|
||||
|
|
|
@ -84,7 +84,7 @@ Color BrushTool::color_for(GUI::MouseEvent const& event)
|
|||
return m_editor->color_for(event);
|
||||
}
|
||||
|
||||
void BrushTool::draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& point)
|
||||
void BrushTool::draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint point)
|
||||
{
|
||||
constexpr auto flow_scale = 10;
|
||||
for (int y = point.y() - size(); y < point.y() + size(); y++) {
|
||||
|
@ -103,7 +103,7 @@ void BrushTool::draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint
|
|||
}
|
||||
}
|
||||
|
||||
void BrushTool::draw_line(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& start, Gfx::IntPoint const& end)
|
||||
void BrushTool::draw_line(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint start, Gfx::IntPoint end)
|
||||
{
|
||||
int length_x = end.x() - start.x();
|
||||
int length_y = end.y() - start.y();
|
||||
|
|
|
@ -46,8 +46,8 @@ protected:
|
|||
virtual StringView tool_name() const override { return "Brush Tool"sv; }
|
||||
|
||||
virtual Color color_for(GUI::MouseEvent const& event);
|
||||
virtual void draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& point);
|
||||
virtual void draw_line(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& start, Gfx::IntPoint const& end);
|
||||
virtual void draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint point);
|
||||
virtual void draw_line(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint start, Gfx::IntPoint end);
|
||||
virtual NonnullRefPtr<Gfx::Bitmap> build_cursor();
|
||||
void refresh_editor_cursor();
|
||||
float m_scale_last_created_cursor = 0;
|
||||
|
|
|
@ -27,7 +27,7 @@ BucketTool::BucketTool()
|
|||
m_cursor = Gfx::Bitmap::try_load_from_file("/res/icons/pixelpaint/bucket.png"sv).release_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
static void flood_fill(Gfx::Bitmap& bitmap, Gfx::IntPoint const& start_position, Color fill_color, int threshold)
|
||||
static void flood_fill(Gfx::Bitmap& bitmap, Gfx::IntPoint start_position, Color fill_color, int threshold)
|
||||
{
|
||||
VERIFY(bitmap.bpp() == 32);
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
namespace PixelPaint {
|
||||
|
||||
void CloneTool::draw_point(Gfx::Bitmap& bitmap, Gfx::Color, Gfx::IntPoint const& point)
|
||||
void CloneTool::draw_point(Gfx::Bitmap& bitmap, Gfx::Color, Gfx::IntPoint point)
|
||||
{
|
||||
if (!m_sample_location.has_value())
|
||||
return;
|
||||
|
@ -45,7 +45,7 @@ void CloneTool::draw_point(Gfx::Bitmap& bitmap, Gfx::Color, Gfx::IntPoint const&
|
|||
}
|
||||
}
|
||||
|
||||
void CloneTool::draw_line(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& start, Gfx::IntPoint const& end)
|
||||
void CloneTool::draw_line(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint start, Gfx::IntPoint end)
|
||||
{
|
||||
if (!m_sample_location.has_value())
|
||||
return;
|
||||
|
|
|
@ -21,8 +21,8 @@ public:
|
|||
virtual bool is_overriding_alt() override { return true; }
|
||||
|
||||
protected:
|
||||
virtual void draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& point) override;
|
||||
virtual void draw_line(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& start, Gfx::IntPoint const& end) override;
|
||||
virtual void draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint point) override;
|
||||
virtual void draw_line(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint start, Gfx::IntPoint end) override;
|
||||
|
||||
virtual void on_mousedown(Layer*, MouseEvent&) override;
|
||||
virtual void on_mousemove(Layer*, MouseEvent&) override;
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
namespace PixelPaint {
|
||||
|
||||
void EllipseTool::draw_using(GUI::Painter& painter, Gfx::IntPoint const& start_position, Gfx::IntPoint const& end_position, int thickness)
|
||||
void EllipseTool::draw_using(GUI::Painter& painter, Gfx::IntPoint start_position, Gfx::IntPoint end_position, int thickness)
|
||||
{
|
||||
Gfx::IntRect ellipse_intersecting_rect;
|
||||
if (m_draw_mode == DrawMode::FromCenter) {
|
||||
|
|
|
@ -41,7 +41,7 @@ private:
|
|||
FromCorner,
|
||||
};
|
||||
|
||||
void draw_using(GUI::Painter&, Gfx::IntPoint const& start_position, Gfx::IntPoint const& end_position, int thickness);
|
||||
void draw_using(GUI::Painter&, Gfx::IntPoint start_position, Gfx::IntPoint end_position, int thickness);
|
||||
|
||||
RefPtr<GUI::Widget> m_properties_widget;
|
||||
RefPtr<GUI::TextBox> m_aspect_w_textbox;
|
||||
|
|
|
@ -28,7 +28,7 @@ Color EraseTool::color_for(GUI::MouseEvent const&)
|
|||
return Color(255, 255, 255, 0);
|
||||
}
|
||||
|
||||
void EraseTool::draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& point)
|
||||
void EraseTool::draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint point)
|
||||
{
|
||||
if (m_draw_mode == DrawMode::Pencil) {
|
||||
int radius = size() / 2;
|
||||
|
|
|
@ -24,7 +24,7 @@ public:
|
|||
|
||||
protected:
|
||||
virtual Color color_for(GUI::MouseEvent const& event) override;
|
||||
virtual void draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& point) override;
|
||||
virtual void draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint point) override;
|
||||
virtual NonnullRefPtr<Gfx::Bitmap> build_cursor() override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
namespace PixelPaint {
|
||||
|
||||
RefPtr<Guide> GuideTool::closest_guide(Gfx::IntPoint const& point)
|
||||
RefPtr<Guide> GuideTool::closest_guide(Gfx::IntPoint point)
|
||||
{
|
||||
auto guides = editor()->guides();
|
||||
Guide* closest_guide = nullptr;
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
private:
|
||||
virtual StringView tool_name() const override { return "Guide Tool"sv; }
|
||||
|
||||
RefPtr<Guide> closest_guide(Gfx::IntPoint const&);
|
||||
RefPtr<Guide> closest_guide(Gfx::IntPoint);
|
||||
|
||||
RefPtr<GUI::Widget> m_properties_widget;
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
namespace PixelPaint {
|
||||
|
||||
static Gfx::IntPoint constrain_line_angle(Gfx::IntPoint const& start_pos, Gfx::IntPoint const& end_pos, float angle_increment)
|
||||
static Gfx::IntPoint constrain_line_angle(Gfx::IntPoint start_pos, Gfx::IntPoint end_pos, float angle_increment)
|
||||
{
|
||||
float current_angle = AK::atan2<float>(end_pos.y() - start_pos.y(), end_pos.x() - start_pos.x()) + float { M_PI * 2 };
|
||||
|
||||
|
@ -56,7 +56,7 @@ void LineTool::on_mousedown(Layer* layer, MouseEvent& event)
|
|||
m_editor->update();
|
||||
}
|
||||
|
||||
void LineTool::draw_using(GUI::Painter& painter, Gfx::IntPoint const& start_position, Gfx::IntPoint const& end_position, Color color, int thickness)
|
||||
void LineTool::draw_using(GUI::Painter& painter, Gfx::IntPoint start_position, Gfx::IntPoint end_position, Color color, int thickness)
|
||||
{
|
||||
if (m_antialias_enabled) {
|
||||
Gfx::AntiAliasingPainter aa_painter { painter };
|
||||
|
|
|
@ -26,7 +26,7 @@ public:
|
|||
virtual GUI::Widget* get_properties_widget() override;
|
||||
virtual Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>> cursor() override { return Gfx::StandardCursor::Crosshair; }
|
||||
|
||||
void draw_using(GUI::Painter&, Gfx::IntPoint const& start_position, Gfx::IntPoint const& end_position, Color color, int thickness);
|
||||
void draw_using(GUI::Painter&, Gfx::IntPoint start_position, Gfx::IntPoint end_position, Color color, int thickness);
|
||||
|
||||
virtual bool is_overriding_alt() override { return true; }
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ void MoveTool::on_mousemove(Layer* layer, MouseEvent& event)
|
|||
}
|
||||
|
||||
if (m_scaling) {
|
||||
auto& cursor_location = event.image_event().position();
|
||||
auto cursor_location = event.image_event().position();
|
||||
auto width = abs(m_layer_being_moved->location().x() - cursor_location.x());
|
||||
auto height = abs(m_layer_being_moved->location().y() - cursor_location.y());
|
||||
if (m_keep_ascept_ratio) {
|
||||
|
|
|
@ -23,13 +23,13 @@ PenTool::PenTool()
|
|||
set_size(1);
|
||||
}
|
||||
|
||||
void PenTool::draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& point)
|
||||
void PenTool::draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint point)
|
||||
{
|
||||
GUI::Painter painter(bitmap);
|
||||
painter.draw_line(point, point, color, size());
|
||||
}
|
||||
|
||||
void PenTool::draw_line(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& start, Gfx::IntPoint const& end)
|
||||
void PenTool::draw_line(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint start, Gfx::IntPoint end)
|
||||
{
|
||||
GUI::Painter painter(bitmap);
|
||||
painter.draw_line(start, end, color, size());
|
||||
|
|
|
@ -22,8 +22,8 @@ public:
|
|||
virtual GUI::Widget* get_properties_widget() override;
|
||||
|
||||
protected:
|
||||
virtual void draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& point) override;
|
||||
virtual void draw_line(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint const& start, Gfx::IntPoint const& end) override;
|
||||
virtual void draw_point(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint point) override;
|
||||
virtual void draw_line(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint start, Gfx::IntPoint end) override;
|
||||
|
||||
private:
|
||||
virtual StringView tool_name() const override { return "Pen Tool"sv; }
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
namespace PixelPaint {
|
||||
|
||||
void RectangleTool::draw_using(GUI::Painter& painter, Gfx::IntPoint const& start_position, Gfx::IntPoint const& end_position, int thickness, int corner_radius)
|
||||
void RectangleTool::draw_using(GUI::Painter& painter, Gfx::IntPoint start_position, Gfx::IntPoint end_position, int thickness, int corner_radius)
|
||||
{
|
||||
Gfx::IntRect rect;
|
||||
if (m_draw_mode == DrawMode::FromCenter) {
|
||||
|
|
|
@ -42,7 +42,7 @@ private:
|
|||
FromCorner,
|
||||
};
|
||||
|
||||
void draw_using(GUI::Painter&, Gfx::IntPoint const& start_position, Gfx::IntPoint const& end_position, int thickness, int corner_radius);
|
||||
void draw_using(GUI::Painter&, Gfx::IntPoint start_position, Gfx::IntPoint end_position, int thickness, int corner_radius);
|
||||
|
||||
RefPtr<GUI::Widget> m_properties_widget;
|
||||
RefPtr<GUI::TextBox> m_aspect_w_textbox;
|
||||
|
|
|
@ -62,7 +62,7 @@ Gfx::IntPoint Tool::editor_layer_location(Layer const& layer) const
|
|||
return (Gfx::FloatPoint { layer.location() } * m_editor->scale()).to_rounded<int>();
|
||||
}
|
||||
|
||||
Gfx::IntPoint Tool::editor_stroke_position(Gfx::IntPoint const& pixel_coords, int stroke_thickness) const
|
||||
Gfx::IntPoint Tool::editor_stroke_position(Gfx::IntPoint pixel_coords, int stroke_thickness) const
|
||||
{
|
||||
auto position = m_editor->content_to_frame_position(pixel_coords);
|
||||
auto offset = (stroke_thickness % 2 == 0) ? 0 : m_editor->scale() / 2;
|
||||
|
|
|
@ -89,7 +89,7 @@ protected:
|
|||
|
||||
Gfx::IntPoint editor_layer_location(Layer const& layer) const;
|
||||
|
||||
virtual Gfx::IntPoint editor_stroke_position(Gfx::IntPoint const& pixel_coords, int stroke_thickness) const;
|
||||
virtual Gfx::IntPoint editor_stroke_position(Gfx::IntPoint pixel_coords, int stroke_thickness) const;
|
||||
|
||||
void set_primary_slider(GUI::ValueSlider* primary) { m_primary_slider = primary; }
|
||||
void set_secondary_slider(GUI::ValueSlider* secondary) { m_secondary_slider = secondary; }
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
namespace PixelPaint {
|
||||
|
||||
static void set_flood_selection(Gfx::Bitmap& bitmap, Image& image, Gfx::IntPoint const& start_position, Gfx::IntPoint const& selection_offset, int threshold, Selection::MergeMode merge_mode)
|
||||
static void set_flood_selection(Gfx::Bitmap& bitmap, Image& image, Gfx::IntPoint start_position, Gfx::IntPoint selection_offset, int threshold, Selection::MergeMode merge_mode)
|
||||
{
|
||||
VERIFY(bitmap.bpp() == 32);
|
||||
|
||||
|
|
|
@ -258,7 +258,7 @@ void TreeMapWidget::paint_event(GUI::PaintEvent& event)
|
|||
}
|
||||
}
|
||||
|
||||
Vector<int> TreeMapWidget::path_to_position(Gfx::IntPoint const& position)
|
||||
Vector<int> TreeMapWidget::path_to_position(Gfx::IntPoint position)
|
||||
{
|
||||
TreeMapNode const* node = path_node(m_viewpoint);
|
||||
if (!node) {
|
||||
|
|
|
@ -64,7 +64,7 @@ private:
|
|||
template<typename Function>
|
||||
void lay_out_children(TreeMapNode const&, Gfx::IntRect const&, int depth, Function);
|
||||
void paint_cell_frame(GUI::Painter&, TreeMapNode const&, Gfx::IntRect const&, Gfx::IntRect const&, int depth, HasLabel has_label) const;
|
||||
Vector<int> path_to_position(Gfx::IntPoint const&);
|
||||
Vector<int> path_to_position(Gfx::IntPoint);
|
||||
|
||||
RefPtr<TreeMap> m_tree;
|
||||
Vector<int> m_path;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue