css: Fix handling of transform values
authorMatthias Clasen <mclasen@redhat.com>
Mon, 18 Jul 2022 11:59:39 +0000 (06:59 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 18 Jul 2022 12:08:01 +0000 (07:08 -0500)
When computing a transform value, there is nothing
to do, but we still need to copy the matrix from
src to dest, since it depends on the other transforms
in the array whether we are using the src or the
dest in the end.

This fixes cases like
-gtk-icon-transform: perspective(100px) matrix(1,2,...);
which would otherwise end up with a zero matrix.

gtk/gtkcsstransformvalue.c

index 0b59cdee87cc429b0623fec3df394c91f0e32135..636fd553cffc350636032ed0f7d1c2313dda2d13 100644 (file)
@@ -287,6 +287,7 @@ gtk_css_transform_compute (GtkCssTransform  *dest,
   switch (src->type)
     {
     case GTK_CSS_TRANSFORM_MATRIX:
+      memcpy (dest, src, sizeof (GtkCssTransform));
       return TRUE;
     case GTK_CSS_TRANSFORM_TRANSLATE:
       dest->translate.x = _gtk_css_value_compute (src->translate.x, property_id, provider, style, parent_style);