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

LibGfx: Make Rect<T> methods work when T is not int or float

Putting the implementations in the .cpp file meant that they only
existed for `IntRect` and `FloatRect`, since those were instantiated at
the bottom of the file. Now they work for other types. :^)

A couple of places in WindowServer had to be modified to disambiguate
between the two `Rect::intersected()` overloads.

Co-authored-by: davidot <davidot@serenityos.org>
This commit is contained in:
Sam Atkins 2022-10-19 19:55:34 +01:00 committed by Linus Groh
parent ae950816b5
commit 732aa2c5c7
4 changed files with 280 additions and 310 deletions

View file

@ -686,7 +686,7 @@ void ConnectionFromClient::invalidate_rect(i32 window_id, Vector<Gfx::IntRect> c
}
auto& window = *(*it).value;
for (size_t i = 0; i < rects.size(); ++i)
window.request_update(rects[i].intersected({ {}, window.size() }), ignore_occlusion);
window.request_update(rects[i].intersected(Gfx::Rect { {}, window.size() }), ignore_occlusion);
}
void ConnectionFromClient::did_finish_painting(i32 window_id, Vector<Gfx::IntRect> const& rects)