Changeset View
Changeset View
Standalone View
Standalone View
src/QuickEditor/SelectionRectangle.qml
Show First 20 Lines • Show All 75 Lines • ▼ Show 20 Line(s) | 64 | MouseArea { | |||
---|---|---|---|---|---|
76 | 76 | | |||
77 | onPressed: { | 77 | onPressed: { | ||
78 | brxLimit = (parent.x + parent.width) - minRectSize; | 78 | brxLimit = (parent.x + parent.width) - minRectSize; | ||
79 | bryLimit = (parent.y + parent.height) - minRectSize; | 79 | bryLimit = (parent.y + parent.height) - minRectSize; | ||
80 | } | 80 | } | ||
81 | 81 | | |||
82 | onPositionChanged: { | 82 | onPositionChanged: { | ||
83 | if ((parent.x + mouse.x) < brxLimit) { | 83 | if ((parent.x + mouse.x) < brxLimit) { | ||
84 | parent.width = parent.width - mouse.x; | | |||
85 | parent.x = parent.x + mouse.x; | 84 | parent.x = parent.x + mouse.x; | ||
85 | parent.width = parent.width - mouse.x; | ||||
86 | } | 86 | } | ||
87 | 87 | | |||
88 | if ((parent.y + mouse.y) < bryLimit) { | 88 | if ((parent.y + mouse.y) < bryLimit) { | ||
89 | parent.height = parent.height - mouse.y; | | |||
90 | parent.y = parent.y + mouse.y; | 89 | parent.y = parent.y + mouse.y; | ||
90 | parent.height = parent.height - mouse.y; | ||||
91 | } | 91 | } | ||
92 | 92 | | |||
93 | drawCanvas.requestPaint(); | 93 | drawCanvas.requestPaint(); | ||
94 | } | 94 | } | ||
95 | } | 95 | } | ||
96 | 96 | | |||
97 | MouseArea { | 97 | MouseArea { | ||
98 | id: hTopRight; | 98 | id: hTopRight; | ||
Show All 14 Lines | |||||
113 | } | 113 | } | ||
114 | 114 | | |||
115 | onPositionChanged: { | 115 | onPositionChanged: { | ||
116 | if ((parent.x + parent.width + mouse.x) > brxLimit) { | 116 | if ((parent.x + parent.width + mouse.x) > brxLimit) { | ||
117 | parent.width = parent.width + mouse.x - mouseAreaSize + 1; | 117 | parent.width = parent.width + mouse.x - mouseAreaSize + 1; | ||
118 | } | 118 | } | ||
119 | 119 | | |||
120 | if ((parent.y + mouse.y) < bryLimit) { | 120 | if ((parent.y + mouse.y) < bryLimit) { | ||
121 | parent.height = parent.height - mouse.y; | | |||
122 | parent.y = parent.y + mouse.y; | 121 | parent.y = parent.y + mouse.y; | ||
122 | parent.height = parent.height - mouse.y; | ||||
123 | } | 123 | } | ||
124 | 124 | | |||
125 | drawCanvas.requestPaint(); | 125 | drawCanvas.requestPaint(); | ||
126 | } | 126 | } | ||
127 | } | 127 | } | ||
128 | 128 | | |||
129 | MouseArea { | 129 | MouseArea { | ||
130 | id: hBottomLeft; | 130 | id: hBottomLeft; | ||
Show All 10 Lines | |||||
141 | 141 | | |||
142 | onPressed: { | 142 | onPressed: { | ||
143 | brxLimit = (parent.x + parent.width) - minRectSize; | 143 | brxLimit = (parent.x + parent.width) - minRectSize; | ||
144 | bryLimit = parent.y + mouseAreaSize + minRectSize; | 144 | bryLimit = parent.y + mouseAreaSize + minRectSize; | ||
145 | } | 145 | } | ||
146 | 146 | | |||
147 | onPositionChanged: { | 147 | onPositionChanged: { | ||
148 | if ((parent.x + mouse.x) < brxLimit) { | 148 | if ((parent.x + mouse.x) < brxLimit) { | ||
149 | parent.width = parent.width - mouse.x; | | |||
150 | parent.x = parent.x + mouse.x; | 149 | parent.x = parent.x + mouse.x; | ||
150 | parent.width = parent.width - mouse.x; | ||||
151 | } | 151 | } | ||
152 | 152 | | |||
153 | if ((parent.y + parent.height + mouse.y) > bryLimit) { | 153 | if ((parent.y + parent.height + mouse.y) > bryLimit) { | ||
154 | parent.height = parent.height + mouse.y - mouseAreaSize + 1; | 154 | parent.height = parent.height + mouse.y - mouseAreaSize + 1; | ||
155 | } | 155 | } | ||
156 | 156 | | |||
157 | drawCanvas.requestPaint(); | 157 | drawCanvas.requestPaint(); | ||
158 | } | 158 | } | ||
Show All 20 Lines | 161 | MouseArea { | |||
179 | onPositionChanged: { | 179 | onPositionChanged: { | ||
180 | if ((parent.x + parent.width + mouse.x) > brxLimit) { | 180 | if ((parent.x + parent.width + mouse.x) > brxLimit) { | ||
181 | parent.width = parent.width + mouse.x - mouseAreaSize + 1; | 181 | parent.width = parent.width + mouse.x - mouseAreaSize + 1; | ||
182 | } | 182 | } | ||
183 | 183 | | |||
184 | if ((parent.y + parent.height + mouse.y) > bryLimit) { | 184 | if ((parent.y + parent.height + mouse.y) > bryLimit) { | ||
185 | parent.height = parent.height + mouse.y - mouseAreaSize + 1; | 185 | parent.height = parent.height + mouse.y - mouseAreaSize + 1; | ||
186 | } | 186 | } | ||
187 | | ||||
187 | drawCanvas.requestPaint(); | 188 | drawCanvas.requestPaint(); | ||
188 | } | 189 | } | ||
189 | } | 190 | } | ||
190 | 191 | | |||
191 | MouseArea { | 192 | MouseArea { | ||
192 | id: hTop; | 193 | id: hTop; | ||
193 | 194 | | |||
194 | property int limit: 0; | 195 | property int limit: 0; | ||
195 | 196 | | |||
196 | anchors.horizontalCenter: parent.horizontalCenter; | 197 | anchors.horizontalCenter: parent.horizontalCenter; | ||
197 | anchors.top: parent.top; | 198 | anchors.top: parent.top; | ||
198 | 199 | | |||
199 | width: mouseAreaSize; | 200 | width: mouseAreaSize; | ||
200 | height: mouseAreaSize; | 201 | height: mouseAreaSize; | ||
201 | cursorShape: Qt.SizeVerCursor; | 202 | cursorShape: Qt.SizeVerCursor; | ||
202 | 203 | | |||
203 | onPressed: { | 204 | onPressed: { | ||
204 | limit = (parent.y + parent.height) - minRectSize; | 205 | limit = (parent.y + parent.height) - minRectSize; | ||
205 | } | 206 | } | ||
206 | 207 | | |||
207 | onPositionChanged: { | 208 | onPositionChanged: { | ||
208 | if ((parent.y + mouse.y) < limit) { | 209 | if ((parent.y + mouse.y) < limit) { | ||
209 | parent.height = parent.height - mouse.y; | | |||
210 | parent.y = parent.y + mouse.y; | 210 | parent.y = parent.y + mouse.y; | ||
211 | parent.height = parent.height - mouse.y; | ||||
211 | } | 212 | } | ||
212 | 213 | | |||
213 | drawCanvas.requestPaint(); | 214 | drawCanvas.requestPaint(); | ||
214 | } | 215 | } | ||
215 | } | 216 | } | ||
216 | 217 | | |||
217 | MouseArea { | 218 | MouseArea { | ||
218 | id: hBottom; | 219 | id: hBottom; | ||
Show All 33 Lines | 243 | MouseArea { | |||
252 | cursorShape: Qt.SizeHorCursor; | 253 | cursorShape: Qt.SizeHorCursor; | ||
253 | 254 | | |||
254 | onPressed: { | 255 | onPressed: { | ||
255 | limit = (parent.x + parent.width) - minRectSize; | 256 | limit = (parent.x + parent.width) - minRectSize; | ||
256 | } | 257 | } | ||
257 | 258 | | |||
258 | onPositionChanged: { | 259 | onPositionChanged: { | ||
259 | if ((parent.x + mouse.x) < limit) { | 260 | if ((parent.x + mouse.x) < limit) { | ||
260 | parent.width = parent.width - mouse.x; | | |||
261 | parent.x = parent.x + mouse.x; | 261 | parent.x = parent.x + mouse.x; | ||
262 | parent.width = parent.width - mouse.x; | ||||
262 | } | 263 | } | ||
263 | 264 | | |||
264 | drawCanvas.requestPaint(); | 265 | drawCanvas.requestPaint(); | ||
265 | } | 266 | } | ||
266 | } | 267 | } | ||
267 | 268 | | |||
268 | MouseArea { | 269 | MouseArea { | ||
269 | id: hRight; | 270 | id: hRight; | ||
Show All 23 Lines |