diff options
author | Hatem ElKharashy <hatem.elkharashy@qt.io> | 2024-03-25 13:24:51 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2024-04-25 10:04:21 +0300 |
commit | 645e1ee76b56fe351170bd76d54dd08d56bb917f (patch) | |
tree | cd3c2deab1232c41b799b379dca05197a05ab218 /tests/manual | |
parent | de436b852586ab03f93418ddf55f90082e93ae03 (diff) |
VectorImage: support stroke styling for paths
SVG different stroke attibutes can be easily mapped to QQuickShapePath
properties.
Task-number: QTBUG-121650
Change-Id: Id52f3e7d99a81c84851b7a7645f75fdee1efbaeb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'tests/manual')
4 files changed, 45 insertions, 0 deletions
diff --git a/tests/manual/svg/data/styling/stroking_capStyle_shapes_1.svg b/tests/manual/svg/data/styling/stroking_capStyle_shapes_1.svg new file mode 100644 index 0000000000..9448fcb527 --- /dev/null +++ b/tests/manual/svg/data/styling/stroking_capStyle_shapes_1.svg @@ -0,0 +1,11 @@ +<svg width="900" height="600" viewBox="0 0 90 60" xmlns="http://www.w3.org/2000/svg"> + <defs> + <g id="capTest"> + <polyline points="10,10 80,10" fill="none" stroke-width="8" stroke="black"/> + <polyline points="10,10 80,10" fill="none" stroke-width="0.5" stroke-linecap="butt" stroke="yellow"/> + </g> + </defs> + <use href="#capTest" stroke-linecap="butt"/> + <use href="#capTest" y="20" stroke-linecap="round"/> + <use href="#capTest" y=" 40" stroke-linecap="square"/> +</svg> diff --git a/tests/manual/svg/data/styling/stroking_capStyle_shapes_2.svg b/tests/manual/svg/data/styling/stroking_capStyle_shapes_2.svg new file mode 100644 index 0000000000..1d52d2d247 --- /dev/null +++ b/tests/manual/svg/data/styling/stroking_capStyle_shapes_2.svg @@ -0,0 +1,12 @@ +<svg width="900" height="300" viewBox="0 0 130 40" xmlns="http://www.w3.org/2000/svg"> + <defs> + <polyline id="letterz" points="10,10 40,10 10,30 40,30" fill="none" stroke-width="2.5" stroke="black"/> + <polyline id="highlight" points="10,10 40,10 10,30 40,30" fill="none" stroke-width="0.1" stroke="yellow"/> + </defs> + <use href="#letterz" stroke-linecap="butt"/> + <use href="#highlight"/> + <use href="#letterz" x="40" stroke-linecap="round"/> + <use href="#highlight" x="40"/> + <use href="#letterz" x=" 80" stroke-linecap="square"/> + <use href="#highlight" x="80"/> +</svg> diff --git a/tests/manual/svg/data/styling/stroking_dash.svg b/tests/manual/svg/data/styling/stroking_dash.svg new file mode 100644 index 0000000000..5fdefa4cce --- /dev/null +++ b/tests/manual/svg/data/styling/stroking_dash.svg @@ -0,0 +1,10 @@ +<svg width="460" height="200" viewBox="0 0 30 13" xmlns="http://www.w3.org/2000/svg"> + <line x1="0" y1="1" x2="30" y2="1" stroke="black" stroke-dashoffset="2"/> + <line x1="0" y1="3" x2="30" y2="3" stroke="black" stroke-dasharray="4 2"/> +<!--positive dashoffset pulls the dashes--> + <line x1="0" y1="5" x2="30" y2="5" stroke="black" stroke-dasharray="4 2" stroke-dashoffset="2"/> + <line x1="0" y1="7" x2="30" y2="7" stroke="black" stroke-dasharray="4 2" stroke-dashoffset="4"/> + <!--negative dashoffset pushs the dashes--> + <line x1="0" y1="9" x2="30" y2="9" stroke="black" stroke-dasharray="4 2" stroke-dashoffset="-2"/> + <line x1="0" y1="11" x2="30" y2="11" stroke="black" stroke-dasharray="4 2" stroke-dashoffset="-4"/> +</svg> diff --git a/tests/manual/svg/data/styling/stroking_joinStyle_shapes_1.svg b/tests/manual/svg/data/styling/stroking_joinStyle_shapes_1.svg new file mode 100644 index 0000000000..1da775a97e --- /dev/null +++ b/tests/manual/svg/data/styling/stroking_joinStyle_shapes_1.svg @@ -0,0 +1,12 @@ +<svg width="600" height="200" viewBox="0 0 30 10" xmlns="http://www.w3.org/2000/svg"> + <defs> + <g id="capTest"> + <polyline points="1,8 1,2 7,2" fill="none" stroke-width="1" stroke="black"/> + <polyline points="1,8 1,2 7,2" fill="none" stroke-width="0.03" stroke="yellow"/> + </g> + </defs> + + <use href="#capTest" x="1" stroke-linejoin="bevel"/> + <use href="#capTest" x="11" stroke-linejoin="round"/> + <use href="#capTest" x="21" stroke-linejoin="miter"/> +</svg> |