rendernode: Handle rotation transforms in opacity calculations

Tests included.
This commit is contained in:
Benjamin Otte 2024-07-09 12:15:01 +02:00
parent 5f719c8ea3
commit 83c2766e3f
3 changed files with 61 additions and 1 deletions

View File

@ -3625,7 +3625,7 @@ gsk_transform_node_get_opaque_rect (GskRenderNode *node,
GskTransformNode *self = (GskTransformNode *) node;
graphene_rect_t child_opaque;
if (gsk_transform_get_category (self->transform) < GSK_TRANSFORM_CATEGORY_2D_AFFINE)
if (gsk_transform_get_fine_category (self->transform) < GSK_FINE_TRANSFORM_CATEGORY_2D_DIHEDRAL)
return FALSE;
if (!gsk_render_node_get_opaque_rect (self->child, &child_opaque))

View File

@ -0,0 +1,32 @@
container {
transform {
transform: scale(1,1);
child: color {
bounds: 50 50 50 50;
color: lime;
}
}
transform {
transform: scale(1,-1);
child: color {
bounds: 50 -50 50 50;
color: red;
}
}
}
container {
transform {
transform: scale(-1,-1);
child: color {
bounds: -50 -50 50 50;
color: yellow;
}
}
transform {
transform: scale(-1,1);
child: color {
bounds: -50 50 50 50;
color: blue;
}
}
}

View File

@ -0,0 +1,28 @@
transform {
transform: rotate(0);
child: color {
bounds: 0 0 50 50;
color: lime;
}
}
transform {
transform: rotate(90);
child: color {
bounds: 0 -100 50 50;
color: red;
}
}
transform {
transform: rotate(180);
child: color {
bounds: -150 -50 50 50;
color: yellow;
}
}
transform {
transform: rotate(270);
child: color {
bounds: -50 150 50 50;
color: blue;
}
}