mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-29 13:24:48 +00:00

Using the commands property we can just paste SVG paths. This makes it much easier to write examples/demos. A good online path designer is for example https://codepen.io/anthonydugois/pen/mewdyZ
18 lines
370 B
Text
18 lines
370 B
Text
|
|
|
|
TestCase := Rectangle {
|
|
Path {
|
|
commands: "M 350 300 L 550 300 ";
|
|
LineTo { x: 10; y: 100; }
|
|
// ^error{Path elements cannot be mixed with the use of the SVG commands property.}
|
|
}
|
|
|
|
property<string> cmds: "M 350 300 L 550 300 ";
|
|
|
|
Path {
|
|
// ^error{The commands property only accepts string literals.}
|
|
commands: cmds;
|
|
}
|
|
|
|
}
|
|
|