WindowServer: Use relative coordinates when flushing screen dirty rects

The framebuffer device expects coordinates relative to itself.
This commit is contained in:
Tom 2021-06-25 20:54:24 -06:00 committed by Andreas Kling
parent c12cbb96ce
commit 708f27ca0e
Notes: sideshowbarker 2024-07-18 11:28:12 +09:00

View file

@ -319,8 +319,8 @@ void ScreenInput::on_receive_keyboard_data(::KeyEvent kernel_event)
void Screen::flush_display(const Gfx::IntRect& flush_region)
{
FBRect rect {
.x = static_cast<unsigned>(flush_region.x()) * scale_factor(),
.y = static_cast<unsigned>(flush_region.y()) * scale_factor(),
.x = (static_cast<unsigned>(flush_region.x()) - m_virtual_rect.left()) * scale_factor(),
.y = (static_cast<unsigned>(flush_region.y()) - m_virtual_rect.top()) * scale_factor(),
.width = static_cast<unsigned>(flush_region.width()) * scale_factor(),
.height = static_cast<unsigned>(flush_region.height() * scale_factor())
};