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

LibGfx: Rename Rect,Point,Size => IntRect,IntPoint,IntSize

This fits nicer with FloatRect,FloatPoint,FloatSize and gives a much
better visual clue about what type of metric is being used.
This commit is contained in:
Andreas Kling 2020-06-10 10:57:59 +02:00
parent 656b01eb0f
commit 116cf92156
212 changed files with 1144 additions and 1144 deletions

View file

@ -153,7 +153,7 @@ void CursorTool::on_keydown(GUI::KeyEvent& event)
}
}
void CursorTool::set_rubber_band_position(const Gfx::Point& position)
void CursorTool::set_rubber_band_position(const Gfx::IntPoint& position)
{
if (m_rubber_band_position == position)
return;
@ -171,11 +171,11 @@ void CursorTool::set_rubber_band_position(const Gfx::Point& position)
m_editor.form_widget().update();
}
Gfx::Rect CursorTool::rubber_band_rect() const
Gfx::IntRect CursorTool::rubber_band_rect() const
{
if (!m_rubber_banding)
return {};
return Gfx::Rect::from_two_points(m_rubber_band_origin, m_rubber_band_position);
return Gfx::IntRect::from_two_points(m_rubber_band_origin, m_rubber_band_position);
}
void CursorTool::on_second_paint(GUI::Painter& painter, GUI::PaintEvent&)

View file

@ -47,14 +47,14 @@ private:
virtual void on_keydown(GUI::KeyEvent&) override;
virtual void on_second_paint(GUI::Painter&, GUI::PaintEvent&) override;
void set_rubber_band_position(const Gfx::Point&);
Gfx::Rect rubber_band_rect() const;
void set_rubber_band_position(const Gfx::IntPoint&);
Gfx::IntRect rubber_band_rect() const;
Gfx::Point m_drag_origin;
HashMap<GUI::Widget*, Gfx::Point> m_positions_before_drag;
Gfx::IntPoint m_drag_origin;
HashMap<GUI::Widget*, Gfx::IntPoint> m_positions_before_drag;
bool m_dragging { false };
bool m_rubber_banding { false };
Gfx::Point m_rubber_band_origin;
Gfx::Point m_rubber_band_position;
Gfx::IntPoint m_rubber_band_origin;
Gfx::IntPoint m_rubber_band_position;
};

View file

@ -80,7 +80,7 @@ void Editor::focusout_event(Core::Event& event)
GUI::TextEditor::focusout_event(event);
}
Gfx::Rect Editor::breakpoint_icon_rect(size_t line_number) const
Gfx::IntRect Editor::breakpoint_icon_rect(size_t line_number) const
{
auto ruler_line_rect = ruler_content_rect(line_number);
@ -140,7 +140,7 @@ static HashMap<String, String>& man_paths()
return paths;
}
void Editor::show_documentation_tooltip_if_available(const String& hovered_token, const Gfx::Point& screen_location)
void Editor::show_documentation_tooltip_if_available(const String& hovered_token, const Gfx::IntPoint& screen_location)
{
auto it = man_paths().find(hovered_token);
if (it == man_paths().end()) {

View file

@ -61,10 +61,10 @@ private:
virtual void enter_event(Core::Event&) override;
virtual void leave_event(Core::Event&) override;
void show_documentation_tooltip_if_available(const String&, const Gfx::Point& screen_location);
void show_documentation_tooltip_if_available(const String&, const Gfx::IntPoint& screen_location);
void navigate_to_include_if_available(String);
Gfx::Rect breakpoint_icon_rect(size_t line_number) const;
Gfx::IntRect breakpoint_icon_rect(size_t line_number) const;
static const Gfx::Bitmap& breakpoint_icon_bitmap();
static const Gfx::Bitmap& current_position_icon_bitmap();