Details
-
Technical task
-
Resolution: Invalid
-
P2: Important
-
None
-
None
Description
Sometimes when switching between CurveRenderer and GeometryRenderer, the fillTransform does not get correctly set.
Take the following example:
import QtQuick import QtQuick.Window import QtQuick.Shapes import QtQuick.Controls import QtQuick.Layouts Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Shape { id: shape preferredRendererType: curveRenderer.checked ? Shape.CurveRenderer : Shape.GeometryRenderer ShapePath { fillColor: "red" strokeColor: "transparent" fillGradient: LinearGradient { x1: 20 y1: 20 x2: 180 y2: 130 GradientStop { position: 0 color: "blue" } GradientStop { position: 0.2 color: "green" } GradientStop { position: 0.4 color: "red" } GradientStop { position: 0.6 color: "yellow" } GradientStop { position: 1 color: "cyan" } } fillTransform: transformed.checked ? PlanarTransform.fromRotate(-90.0, shape.width / 2, shape.height / 2) : Qt.matrix4x4() PathPolyline { path: [ Qt.point(40, 90), Qt.point(150, 60), Qt.point(250, 110), Qt.point(300, 110), Qt.point(200, 190), Qt.point(40, 90) ] } } } RowLayout { anchors.bottom: parent.bottom anchors.left: parent.left anchors.right: parent.right CheckBox { id: transformed text: "Transformed" } CheckBox { id: curveRenderer text: "Curve Renderer" } } }
Run it and check the "transformed" check box to rotate the gradient. Then check the "Curve Renderer" box to switch renderer. The transform goes back to the original and you have to uncheck and recheck the transformed box to get it correct.
The same happens when switching back to GeometryRenderer.