Merge branch 'path-node-tests' into 'main'

css: Replace border rendering code with GskPath

See merge request GNOME/gtk!6341
This commit is contained in:
Matthias Clasen 2023-08-26 12:13:04 +00:00
commit a4df8d8818
6 changed files with 73 additions and 0 deletions

View File

@ -147,6 +147,19 @@ Creates a node like `gsk_cross_fade_node_new()` with the given properties.
Creates a node like `gsk_debug_node_new()` with the given properties.
### fill
| property | syntax | default | printed |
| --------- | --------------- | ---------------------- | ----------- |
| child | `<node>` | *see below* | always |
| path | `<string>` | "" | always |
| fill-rule | `<fill-rule>` | winding | always |
Creates a node like `gsk_fill_node_new()` with the given properties.
The default child node is the default color node, but created with the
bounds of the path.
### glshader
| property | syntax | default | printed |
@ -289,6 +302,24 @@ Creates a node like `gsk_rounded_clip_node_new()` with the given properties.
Creates a node like `gsk_shadow_node_new()` with the given properties.
### stroke
| property | syntax | default | printed |
| ----------- | ------------------ | ----------------- | ----------- |
| child | `<node>` | *see below* | always |
| path | `<string>` | "" | always |
| line-width | `<number>` | 0 | non-default |
| line-cap | `<line-cap>` | butt | always |
| line-join | `<line-join>` | miter | always |
| miter-limit | `<number>` | 4 | non-default |
| dash | `<number>{+}|none` | none | non-default |
| dash-offset | `<number>` | 0 | non-default |
Creates a node like `gsk_stroke_node_new()` with the given properties.
The default child node is the default color node, but created with the
stroke bounds of the path.
### text
| property | syntax | default | printed |

View File

@ -295,6 +295,8 @@ node_parser_tests = [
'empty-transform.ref.node',
'fill.node',
'fill.ref.node',
'fill2.node',
'fill2.ref.node',
'glshader.node',
'glshader.ref.node',
'glshader.errors',

View File

@ -0,0 +1,4 @@
fill {
path: "M 0 0 O 10 10 20 20 5";
fill-rule: even-odd;
}

View File

@ -0,0 +1,9 @@
fill {
child: color {
bounds: 0 0 20 20;
color: rgb(255,0,204);
}
path: "\
M 0 0 O 10 10, 20 20, 5";
fill-rule: even-odd;
}

View File

@ -0,0 +1,10 @@
stroke {
child: color { bounds: 0 0 100 100; color: red; }
path: "M 10, 10 L 90, 90 M 90, 10 L 10, 90";
line-width: 2.5;
line-cap: butt;
line-join: miter;
miter-limit: 3.1;
dash: 0 1 4.5 10;
dash-offset: 2.1;
}

View File

@ -0,0 +1,17 @@
stroke {
child: color {
bounds: 0 0 100 100;
color: rgb(255,0,0);
}
path: "\
M 10 10\
L 90 90\
M 90 10\
L 10 90";
line-width: 2.5;
line-cap: butt;
line-join: miter;
miter-limit: 3.1;
dash: 0 1 4.5 10;
dash-offset: 2.1;
}