From 18c37862b127c024bac25ea8c2045b2855a29e38 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=98yvind=20Kol=C3=A5s?= <pippin@gimp.org>
Date: Wed, 6 Sep 2023 14:55:52 +0200
Subject: [PATCH] py,ui: revert to old behavior of view transition blend

This works in most cases, but instead of the *whole* group first getting
composited and then adjusted it is the alpha of all individual draw calls
that are tweaked through the global alpha.

Issue #122, I am not sure compositing groups have ever worked properly - it is
a very little tested feature. The API was used wrong anyways the global opacity
changed the opacity of all render sources in the incoming view to have bits of
transparency, so there might have been no pixel compositing going on, or if it
was it was on pre-made-transparent bits instead of a texture being made
transparent during compositing.
---
 python_payload/st3m/ui/view.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/python_payload/st3m/ui/view.py b/python_payload/st3m/ui/view.py
index 4c1801e224..77ef56461d 100644
--- a/python_payload/st3m/ui/view.py
+++ b/python_payload/st3m/ui/view.py
@@ -89,10 +89,10 @@ class ViewTransitionBlend(ViewTransition):
     ) -> None:
         outgoing.draw(ctx)
 
-        ctx.start_group()
-        incoming.draw(ctx)
+        ctx.save()
         ctx.global_alpha = transition
-        ctx.end_group()
+        incoming.draw(ctx)
+        ctx.restore()
 
 
 class ViewTransitionSwipeLeft(ViewTransition):
-- 
GitLab