TheIndependentAquarius
5th June 2014, 11:10
import QtQuick 2.0
Item
{
width: 660
height: 660
Rectangle
{
id : dial
width: 360
height: 360
color: "gray"
Rectangle
{
id: dot
height: 5
width: 5
color: "red"
x: dial.x + (dial.width/2);
y: dial.y + (dial.height/2);
}
Image
{
id: line
source: "/home/.../documents/test/straightLine.jpg"
height: 50
width: 50
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
transform: Rotation
{
origin.x: dial.x + (dial.width/2);
origin.y: dial.y + (dial.height/2);
angle: 40
}
}
}
}
The dot is a representation of the origin point. The line's center point should stay at that origin.
When I apply the angle : 40, the line moves away from its origin.
How to tell it to say at that origin while rotating?
Item
{
width: 660
height: 660
Rectangle
{
id : dial
width: 360
height: 360
color: "gray"
Rectangle
{
id: dot
height: 5
width: 5
color: "red"
x: dial.x + (dial.width/2);
y: dial.y + (dial.height/2);
}
Image
{
id: line
source: "/home/.../documents/test/straightLine.jpg"
height: 50
width: 50
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
transform: Rotation
{
origin.x: dial.x + (dial.width/2);
origin.y: dial.y + (dial.height/2);
angle: 40
}
}
}
}
The dot is a representation of the origin point. The line's center point should stay at that origin.
When I apply the angle : 40, the line moves away from its origin.
How to tell it to say at that origin while rotating?