svg_loader: Add missing implementation of skewX and skewY in transform-list

This commit is contained in:
Mew Pur Pur 2024-01-22 11:52:37 +02:00 committed by GitHub
parent 4678372c22
commit de00104566
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -786,6 +786,16 @@ static Matrix* _parseTransformationMatrix(const char* value)
if (ptCount == 2) sy = points[1];
Matrix tmp = { sx, 0, 0, 0, sy, 0, 0, 0, 1 };
_matrixCompose(matrix, &tmp, matrix);
} else if (state == MatrixState::SkewX) {
if (ptCount != 1) goto error;
auto deg = tanf(points[0] * (M_PI / 180.0));
Matrix tmp = { 1, deg, 0, 0, 1, 0, 0, 0, 1 };
_matrixCompose(matrix, &tmp, matrix);
} else if (state == MatrixState::SkewY) {
if (ptCount != 1) goto error;
auto deg = tanf(points[0] * (M_PI / 180.0));
Matrix tmp = { 1, 0, 0, deg, 1, 0, 0, 0, 1 };
_matrixCompose(matrix, &tmp, matrix);
}
}
return matrix;