-
Notifications
You must be signed in to change notification settings - Fork 1
/
ResizeRectangle.qml
78 lines (71 loc) · 1.83 KB
/
ResizeRectangle.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import QtQuick 2.0
Item {
id: resizeRectangle
property var target: parent
property bool forceSquare: false
anchors.fill: target
ResizeHandle {
id: topLeft
target: resizeRectangle.target
anchors {
left: parent.left
top: parent.top
leftMargin: -width / 2
topMargin: -height / 2
}
cursorShape: Qt.SizeFDiagCursor
xFactor: 1.0
yFactor: 1.0
widthFactor: -1.0
heightFactor: -1.0
forceSquare: resizeRectangle.forceSquare
}
ResizeHandle {
id: bottomLeft
target: resizeRectangle.target
anchors {
left: parent.left
bottom: parent.bottom
leftMargin: -width / 2
bottomMargin: -height / 2
}
cursorShape: Qt.SizeBDiagCursor
xFactor: 1.0
yFactor: 0.0
widthFactor: -1.0
heightFactor: 1.0
forceSquare: resizeRectangle.forceSquare
}
ResizeHandle {
id: topRight
anchors {
right: parent.right
top: parent.top
rightMargin: -width / 2
topMargin: -height / 2
}
cursorShape: Qt.SizeBDiagCursor
target: resizeRectangle.target
xFactor: 0.0
yFactor: 1.0
widthFactor: 1.0
heightFactor: -1.0
forceSquare: resizeRectangle.forceSquare
}
ResizeHandle {
id: bottomRight
anchors {
right: parent.right
bottom: parent.bottom
rightMargin: -width / 2
bottomMargin: -height / 2
}
cursorShape: Qt.SizeFDiagCursor
target: resizeRectangle.target
xFactor: 0.0
yFactor: 0.0
widthFactor: 1.0
heightFactor: 1.0
forceSquare: resizeRectangle.forceSquare
}
}