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

@ -54,12 +54,12 @@ String MonitorWidget::wallpaper_mode()
return m_desktop_wallpaper_mode;
}
void MonitorWidget::set_desktop_resolution(Gfx::Size resolution)
void MonitorWidget::set_desktop_resolution(Gfx::IntSize resolution)
{
m_desktop_resolution = resolution;
}
Gfx::Size MonitorWidget::desktop_resolution()
Gfx::IntSize MonitorWidget::desktop_resolution()
{
return m_desktop_resolution;
}
@ -76,7 +76,7 @@ Gfx::Color MonitorWidget::background_color()
void MonitorWidget::paint_event(GUI::PaintEvent& event)
{
Gfx::Rect screen_rect = { 0, 0, m_desktop_resolution.width(), m_desktop_resolution.height() };
Gfx::IntRect screen_rect = { 0, 0, m_desktop_resolution.width(), m_desktop_resolution.height() };
auto screen_bitmap = Gfx::Bitmap::create(m_monitor_bitmap->format(), m_desktop_resolution);
GUI::Painter screen_painter(*screen_bitmap);
screen_painter.fill_rect(screen_rect, m_desktop_color);
@ -85,7 +85,7 @@ void MonitorWidget::paint_event(GUI::PaintEvent& event)
if (m_desktop_wallpaper_mode == "simple") {
screen_painter.blit({ 0, 0 }, *m_desktop_wallpaper_bitmap, m_desktop_wallpaper_bitmap->rect());
} else if (m_desktop_wallpaper_mode == "center") {
Gfx::Point offset { screen_rect.width() / 2 - m_desktop_wallpaper_bitmap->size().width() / 2, screen_rect.height() / 2 - m_desktop_wallpaper_bitmap->size().height() / 2 };
Gfx::IntPoint offset { screen_rect.width() / 2 - m_desktop_wallpaper_bitmap->size().width() / 2, screen_rect.height() / 2 - m_desktop_wallpaper_bitmap->size().height() / 2 };
screen_painter.blit_offset(screen_rect.location(), *m_desktop_wallpaper_bitmap, screen_rect, offset);
} else if (m_desktop_wallpaper_mode == "tile") {
screen_painter.draw_tiled_bitmap(screen_bitmap->rect(), *m_desktop_wallpaper_bitmap);