1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:17: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

@ -133,7 +133,7 @@ Window& Menu::ensure_menu_window()
else if (item.type() == MenuItem::Separator)
height = 8;
item.set_rect({ next_item_location, { width - frame_thickness() * 2, height } });
next_item_location.move_by(0, height);
next_item_location.translate_by(0, height);
}
int window_height_available = Screen::the().height() - frame_thickness() * 2;
@ -236,7 +236,7 @@ void Menu::draw()
painter.blit_filtered(icon_rect.location().translated(1, 1), *item.icon(), item.icon()->rect(), [&shadow_color](auto) {
return shadow_color;
});
icon_rect.move_by(-1, -1);
icon_rect.translate_by(-1, -1);
}
if (item.is_enabled())
painter.blit(icon_rect.location(), *item.icon(), item.icon()->rect());