transform: Treat 0 perspective transforms as identity

This happens if you apply a perspective transform and its inverse, which
is the negative version of the perspective.
This commit is contained in:
Benjamin Otte 2019-06-02 15:06:50 +02:00
parent 22e0785802
commit 69629ebb1a

View File

@ -1118,7 +1118,7 @@ gsk_perspective_transform_to_matrix (GskTransform *transform,
GskPerspectiveTransform *self = (GskPerspectiveTransform *) transform;
float f[16] = { 1.f, 0.f, 0.f, 0.f,
0.f, 1.f, 0.f, 0.f,
0.f, 0.f, 1.f, -1.f / self->depth,
0.f, 0.f, 1.f, self->depth ? -1.f / self->depth : 0.f,
0.f, 0.f, 0.f, 1.f };
graphene_matrix_init_from_float (out_matrix, f);