ref: 2334bbcfe1b0137c8e271bc9d14f18f5d29132ae
parent: 26a582e3bf1c9facd5291be6f25eff320dda5472
author: sirjofri <sirjofri@sirjofri.de>
date: Fri Aug 9 12:07:40 EDT 2024
fixes compositing chain bug
--- a/blie.c
+++ b/blie.c
@@ -105,6 +105,8 @@
return 1;
}
+int nextlayerdirty; // while docomp, is next layer dirty?
+
static void
docomp(Layer *l, int id, int, void *aux)
{
@@ -120,9 +122,13 @@
c = ed->composite ? ed->composite : ecomposite;
- // BUG: doesn't recomposite if previous layer changed!
- if (!l->composited)
+ if (nextlayerdirty)
+ dirtylayer(l);
+
+ if (!l->composited) {
l->composited = c(l, img[i]);
+ nextlayerdirty = 1;
+ }
img[id%2] = l->composited;
img[i] = nil;
}
@@ -136,6 +142,7 @@
img[0] = nil;
img[1] = nil;
i = (foreachlayer(docomp, img) + 1) % 2;
+ nextlayerdirty = 0;
writememimage(1, img[i]);
}
@@ -154,6 +161,7 @@
img[0] = nil;
img[1] = nil;
i = (foreachlayer(docomp, img) + 1) % 2;
+ nextlayerdirty = 0;
sampleview(panels.drawing, img[i]);