mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
WindowServer: Draw minimize animation inverted
Inverting the pixels makes the animation visible over most colors.
This commit is contained in:
parent
607c78336b
commit
0c2d36d1cd
Notes:
sideshowbarker
2024-07-19 02:50:49 +09:00
Author: https://github.com/tomuta Commit: https://github.com/SerenityOS/serenity/commit/0c2d36d1cd6 Pull-request: https://github.com/SerenityOS/serenity/pull/3435
1 changed files with 4 additions and 1 deletions
|
@ -641,6 +641,9 @@ void Compositor::flip_buffers()
|
|||
void Compositor::run_animations(Gfx::DisjointRectSet& flush_rects)
|
||||
{
|
||||
static const int minimize_animation_steps = 10;
|
||||
auto& painter = *m_back_painter;
|
||||
Gfx::PainterStateSaver saver(painter);
|
||||
painter.set_draw_op(Gfx::Painter::DrawOp::Invert);
|
||||
|
||||
WindowManager::the().for_each_window([&](Window& window) {
|
||||
if (window.in_minimize_animation()) {
|
||||
|
@ -665,7 +668,7 @@ void Compositor::run_animations(Gfx::DisjointRectSet& flush_rects)
|
|||
dbg() << "Minimize animation from " << from_rect << " to " << to_rect << " frame# " << animation_index << " " << rect;
|
||||
#endif
|
||||
|
||||
m_back_painter->draw_rect(rect, Color::White);
|
||||
painter.draw_rect(rect, Color::Transparent); // Color doesn't matter, we draw inverted
|
||||
flush_rects.add(rect);
|
||||
invalidate_screen(rect);
|
||||
|
||||
|
|
Loading…
Reference in a new issue