mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:07:45 +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
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)
|
void Compositor::run_animations(Gfx::DisjointRectSet& flush_rects)
|
||||||
{
|
{
|
||||||
static const int minimize_animation_steps = 10;
|
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) {
|
WindowManager::the().for_each_window([&](Window& window) {
|
||||||
if (window.in_minimize_animation()) {
|
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;
|
dbg() << "Minimize animation from " << from_rect << " to " << to_rect << " frame# " << animation_index << " " << rect;
|
||||||
#endif
|
#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);
|
flush_rects.add(rect);
|
||||||
invalidate_screen(rect);
|
invalidate_screen(rect);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue