aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-01-29 12:14:20 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-01-29 14:45:41 +0100
commit19a74ba56e58e007449486b0f545be7415a9f95b (patch)
tree04f6a5b4a20d5fa49d721407561612d7a7753323 /tests/manual
parent4b1c40570300248a7a7744aa7ddf8e77457bdc2b (diff)
Fix vertical position of PathText
The PathText would always translate to y=0, regardless of what y was set to. We should obviously get the y coordinate of the shape *before* translating it into position to find the distance from the baseline. This change also updates the example, which had not been updated to the changed origin of the PathText, and it adds a Lancelot test for keeping track of the PathText shape rendering. Change-Id: I940ac956af5229842739f8d8751a1f13bb86b8e7 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'tests/manual')
-rw-r--r--tests/manual/scenegraph_lancelot/data/shape/shape_text.qml91
1 files changed, 91 insertions, 0 deletions
diff --git a/tests/manual/scenegraph_lancelot/data/shape/shape_text.qml b/tests/manual/scenegraph_lancelot/data/shape/shape_text.qml
new file mode 100644
index 0000000000..37367054b5
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shape/shape_text.qml
@@ -0,0 +1,91 @@
+import QtQuick 2.15
+import QtQuick.Shapes 1.0
+
+Item {
+ width: 320
+ height: 480
+
+ Column {
+ Item {
+ width: 200
+ height: 160
+
+ Shape {
+ anchors.fill: parent
+ vendorExtensionsEnabled: false
+
+ ShapePath {
+ fillColor: "transparent"
+ strokeColor: "blue"
+ strokeStyle: ShapePath.DashLine
+ strokeWidth: 4
+
+ PathText {
+ x: 96
+ y: 10
+ font.pixelSize: 120
+ text: "Qt"
+ }
+ }
+ }
+ }
+
+ Item {
+ width: 200
+ height: 160
+
+ Rectangle {
+ anchors.fill: parent
+ color: "blue"
+ }
+
+ Shape {
+ anchors.fill: parent
+ vendorExtensionsEnabled: false
+
+ ShapePath {
+ fillColor: "red"
+ strokeColor: "blue"
+ strokeStyle: ShapePath.DashLine
+ capStyle: ShapePath.RoundCap
+ strokeWidth: 8
+
+ PathText {
+ x: 96; y: 10
+ font.pixelSize: 150
+ text: "Qt"
+ }
+ }
+ }
+ }
+
+ Item {
+ width: 200
+ height: 160
+
+ Shape {
+ anchors.fill: parent
+ vendorExtensionsEnabled: false
+
+ ShapePath {
+ fillGradient: LinearGradient {
+ x1: 0; x2: 200; y1: 0; y2: 160
+ spread: ShapeGradient.PadSpread
+ GradientStop { position: 0.0; color: "red"; }
+ GradientStop { position: 1.0; color: "green"; }
+ }
+ strokeColor: "blue"
+ strokeStyle: ShapePath.DashLine
+ joinStyle: ShapePath.RoundJoin
+ strokeWidth: 4
+
+ PathText {
+ x: 96; y: 10
+ font.pixelSize: 150
+ text: "Qt"
+ }
+ }
+ }
+ }
+ }
+}