1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:37:35 +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:
Matthew Olsson 2021-04-12 11:47:09 -07:00 committed by Andreas Kling
parent ac238b3bd6
commit 88cfaf7bf0
48 changed files with 282 additions and 187 deletions

View file

@ -301,7 +301,7 @@ void WindowFrame::paint_menubar(Gfx::Painter& painter)
auto text_rect = menu.rect_in_window_menubar();
Color text_color = palette.window_text();
if (MenuManager::the().is_open(menu))
text_rect.move_by(1, 1);
text_rect.translate_by(1, 1);
bool paint_as_pressed = MenuManager::the().is_open(menu);
bool paint_as_hovered = !paint_as_pressed && &menu == MenuManager::the().hovered_menu();
if (paint_as_pressed || paint_as_hovered) {
@ -546,7 +546,7 @@ void WindowFrame::invalidate(Gfx::IntRect relative_rect)
{
auto frame_rect = rect();
auto window_rect = m_window.rect();
relative_rect.move_by(frame_rect.x() - window_rect.x(), frame_rect.y() - window_rect.y());
relative_rect.translate_by(frame_rect.x() - window_rect.x(), frame_rect.y() - window_rect.y());
m_dirty = true;
m_window.invalidate(relative_rect, true);
}