core/colorpipeline: fix matrix multiplication order when optimizing matrix operations

The other matrix needs to be applied first, so it must be on the right side in
the matrix multiplication
This commit is contained in:
Xaver Hugl 2024-08-13 14:07:14 +02:00
parent 388082cb3d
commit 7bdab9c4d2

View file

@ -198,7 +198,7 @@ void ColorPipeline::addMatrix(const QMatrix4x4 &mat, const ValueRange &output)
if (!ops.empty()) {
auto *lastOp = &ops.back().operation;
if (const auto otherMat = std::get_if<ColorMatrix>(lastOp)) {
otherMat->mat *= mat;
otherMat->mat = mat * otherMat->mat;
ops.back().output = output;
return;
} else if (const auto mult = std::get_if<ColorMultiplier>(lastOp)) {