1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:07:47 +00:00

WindowServer: Implement scaled backgrounds and scaled blitting function

This commit is contained in:
Christopher Dumas 2019-06-05 09:23:27 -07:00 committed by Andreas Kling
parent c72953cf06
commit 90d924a97c
3 changed files with 35 additions and 5 deletions

View file

@ -104,10 +104,10 @@ void WSCompositor::compose()
} else if (m_wallpaper_mode == WallpaperMode::Tile) {
m_back_painter->blit_tiled(dirty_rect.location(), *m_wallpaper, dirty_rect);
} else {
// FIXME: Does not work: offset rect creates trails.
m_back_painter->draw_scaled_bitmap(dirty_rect, *m_wallpaper,
{ dirty_rect.location(),
m_wallpaper->size() });
float hscale = (float)m_wallpaper->size().width() / (float)ws.size().width();
float vscale = (float)m_wallpaper->size().height() / (float)ws.size().height();
m_back_painter->blit_scaled(dirty_rect.location(), *m_wallpaper, dirty_rect, hscale, vscale);
}
}
}