mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-12 20:00:09 +00:00
gl renderer: Fix rounded rect intersection code
Test case attached. Fixes #1920
This commit is contained in:
parent
aa267c1c84
commit
f1996783ec
@ -1072,13 +1072,14 @@ gsk_rounded_rect_intersection (const GskRoundedRect *outer,
|
||||
gboolean contained_x;
|
||||
gboolean contained_y;
|
||||
|
||||
if (graphene_rect_contains_rect (outer_bounds, inner_bounds))
|
||||
get_inner_rect (outer, &outer_inner);
|
||||
|
||||
if (graphene_rect_contains_rect (&outer_inner, inner_bounds))
|
||||
{
|
||||
*out_intersection = *inner;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
get_inner_rect (outer, &outer_inner);
|
||||
get_inner_rect (inner, &inner_inner);
|
||||
|
||||
contained_x = outer_inner.origin.x <= inner_inner.origin.x &&
|
||||
|
48
testsuite/gsk/compare/clip-nested1.node
Normal file
48
testsuite/gsk/compare/clip-nested1.node
Normal file
@ -0,0 +1,48 @@
|
||||
transform {
|
||||
transform: scale(8);
|
||||
child:container {
|
||||
|
||||
rounded-clip {
|
||||
clip: 0 0 50 50 / 30 0 0 0;
|
||||
child: rounded-clip {
|
||||
clip: 0 0 100 100 / 0;
|
||||
child: color {
|
||||
bounds: 0 0 50 50;
|
||||
color: teal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
debug {
|
||||
message: "Clipped-out area";
|
||||
child: container {
|
||||
color {
|
||||
color: black;
|
||||
bounds: 0 16 5 14;
|
||||
}
|
||||
color {
|
||||
color: black;
|
||||
bounds: 3 12 5 5;
|
||||
}
|
||||
color {
|
||||
color: black;
|
||||
bounds: 6 7 5 5;
|
||||
}
|
||||
color {
|
||||
color: black;
|
||||
bounds: 10 3 5 5;
|
||||
}
|
||||
color {
|
||||
color: black;
|
||||
bounds: 15 0 5 5;
|
||||
}
|
||||
color {
|
||||
color: black;
|
||||
bounds: 19 0 14 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
BIN
testsuite/gsk/compare/clip-nested1.png
Normal file
BIN
testsuite/gsk/compare/clip-nested1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
@ -54,6 +54,8 @@ compare_render_tests = [
|
||||
'scaled-cairo',
|
||||
'shadow-in-opacity',
|
||||
'texture-url',
|
||||
'color-matrix-identity',
|
||||
'clip-nested1',
|
||||
]
|
||||
|
||||
renderers = [
|
||||
|
Loading…
Reference in New Issue
Block a user