mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:17:36 +00:00
LibGfx: Unify Rect, Point, and Size
This commit unifies methods and method/param names between the above classes, as well as adds [[nodiscard]] and ALWAYS_INLINE where appropriate. It also renamed the various move_by methods to translate_by, as that more closely matches the transformation terminology.
This commit is contained in:
parent
ac238b3bd6
commit
88cfaf7bf0
48 changed files with 282 additions and 187 deletions
|
@ -541,7 +541,7 @@ bool Window::invalidate_no_notify(const Gfx::IntRect& rect, bool with_frame)
|
|||
|
||||
auto outer_rect = frame().render_rect();
|
||||
auto inner_rect = rect;
|
||||
inner_rect.move_by(position());
|
||||
inner_rect.translate_by(position());
|
||||
// FIXME: This seems slightly wrong; the inner rect shouldn't intersect the border part of the outer rect.
|
||||
inner_rect.intersect(outer_rect);
|
||||
if (inner_rect.is_empty())
|
||||
|
@ -976,7 +976,7 @@ void Window::set_menubar(Menubar* menubar)
|
|||
m_menubar->for_each_menu([&](Menu& menu) {
|
||||
int text_width = wm.font().width(Gfx::parse_ampersand_string(menu.name()));
|
||||
menu.set_rect_in_window_menubar({ next_menu_location.x(), 0, text_width + menubar_menu_margin, menubar_rect.height() });
|
||||
next_menu_location.move_by(menu.rect_in_window_menubar().width(), 0);
|
||||
next_menu_location.translate_by(menu.rect_in_window_menubar().width(), 0);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue