snapshot: Fix merging color matrix nodes
authorSergey Bugaev <bugaevc@gmail.com>
Tue, 15 Aug 2023 08:03:25 +0000 (11:03 +0300)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 24 Aug 2023 14:23:13 +0000 (10:23 -0400)
commit582d368653501e37f707fd82c9b2ce3bb978adc7
treed3161da4e1cbe586f17ab779bba3ec2ccbbcad19
parent294bc262cddcc5003c664afd6f6e4659505aea41
snapshot: Fix merging color matrix nodes

The code was appliying the matrices in the wrong order: we have to apply
the inner node's matrix first, and the outer one second. Due to the
matrices being implicitly transposed, the matrix multiplication was done
in the right order, yet the wrong matrix was being mutliplied by the
wrong offset vector.

To make the code a little easier to follow, create explicit variables
for the resulting matrix and offset (instead of reusing matrix2 and
offset2), and fix & expand the comment to document how matrix
transposition factors into this.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
gtk/gtksnapshot.c