RectangleControl.qml (shotcut-22.10.22) | : | RectangleControl.qml (shotcut-22.11.25) | ||
---|---|---|---|---|
skipping to change at line 250 | skipping to change at line 250 | |||
topHandle.anchors.horizontalCenter = rectangle.horizontalCenter; | topHandle.anchors.horizontalCenter = rectangle.horizontalCenter; | |||
topHandle.anchors.top = rectangle.top; | topHandle.anchors.top = rectangle.top; | |||
bottomHandle.anchors.horizontalCenter = rectangle.horizontalCent er; | bottomHandle.anchors.horizontalCenter = rectangle.horizontalCent er; | |||
bottomHandle.anchors.bottom = rectangle.bottom; | bottomHandle.anchors.bottom = rectangle.bottom; | |||
leftHandle.anchors.verticalCenter = rectangle.verticalCenter; | leftHandle.anchors.verticalCenter = rectangle.verticalCenter; | |||
leftHandle.anchors.left = rectangle.left; | leftHandle.anchors.left = rectangle.left; | |||
rightHandle.anchors.verticalCenter = rectangle.verticalCenter; | rightHandle.anchors.verticalCenter = rectangle.verticalCenter; | |||
rightHandle.anchors.right = rectangle.right; | rightHandle.anchors.right = rectangle.right; | |||
} | } | |||
onPositionChanged: { | onPositionChanged: { | |||
rectangle.x = snapX(rectangle.x + rectangle.width / 2) - rectang | if (!(mouse.modifiers & Qt.AltModifier)) { | |||
le.width / 2; | rectangle.x = snapX(rectangle.x + rectangle.width / 2) - rec | |||
rectangle.y = snapY(rectangle.y + rectangle.height / 2) - rectan | tangle.width / 2; | |||
gle.height / 2; | rectangle.y = snapY(rectangle.y + rectangle.height / 2) - re | |||
ctangle.height / 2; | ||||
} | ||||
rectChanged(rectangle); | rectChanged(rectangle); | |||
} | } | |||
onReleased: { | onReleased: { | |||
rectChanged(rectangle); | rectChanged(rectangle); | |||
rectangle.anchors.top = topLeftHandle.top; | rectangle.anchors.top = topLeftHandle.top; | |||
rectangle.anchors.left = topLeftHandle.left; | rectangle.anchors.left = topLeftHandle.left; | |||
rectangle.anchors.right = bottomRightHandle.right; | rectangle.anchors.right = bottomRightHandle.right; | |||
rectangle.anchors.bottom = bottomRightHandle.bottom; | rectangle.anchors.bottom = bottomRightHandle.bottom; | |||
topLeftHandle.anchors.left = undefined; | topLeftHandle.anchors.left = undefined; | |||
topLeftHandle.anchors.top = undefined; | topLeftHandle.anchors.top = undefined; | |||
skipping to change at line 379 | skipping to change at line 381 | |||
topHandle.anchors.horizontalCenter = rectangle.horizontalCenter; | topHandle.anchors.horizontalCenter = rectangle.horizontalCenter; | |||
topHandle.anchors.top = rectangle.top; | topHandle.anchors.top = rectangle.top; | |||
bottomHandle.anchors.horizontalCenter = rectangle.horizontalCent er; | bottomHandle.anchors.horizontalCenter = rectangle.horizontalCent er; | |||
bottomHandle.anchors.bottom = rectangle.bottom; | bottomHandle.anchors.bottom = rectangle.bottom; | |||
leftHandle.anchors.verticalCenter = rectangle.verticalCenter; | leftHandle.anchors.verticalCenter = rectangle.verticalCenter; | |||
leftHandle.anchors.left = rectangle.left; | leftHandle.anchors.left = rectangle.left; | |||
rightHandle.anchors.verticalCenter = rectangle.verticalCenter; | rightHandle.anchors.verticalCenter = rectangle.verticalCenter; | |||
rightHandle.anchors.right = rectangle.right; | rightHandle.anchors.right = rectangle.right; | |||
} | } | |||
onPositionChanged: { | onPositionChanged: { | |||
topLeftHandle.x = snapX(topLeftHandle.x); | if (!(mouse.modifiers & Qt.AltModifier)) { | |||
topLeftHandle.y = snapY(topLeftHandle.y); | topLeftHandle.x = snapX(topLeftHandle.x); | |||
topLeftHandle.y = snapY(topLeftHandle.y); | ||||
} | ||||
if (aspectRatio !== 0) | if (aspectRatio !== 0) | |||
parent.x = topRightHandle.x + handleSize - rectangle.height * aspectRatio; | parent.x = topRightHandle.x + handleSize - rectangle.height * aspectRatio; | |||
parent.x = Math.min(parent.x, bottomRightHandle.x); | parent.x = Math.min(parent.x, bottomRightHandle.x); | |||
parent.y = Math.min(parent.y, bottomRightHandle.y); | parent.y = Math.min(parent.y, bottomRightHandle.y); | |||
rectChanged(rectangle); | rectChanged(rectangle); | |||
} | } | |||
onReleased: { | onReleased: { | |||
rectChanged(rectangle); | rectChanged(rectangle); | |||
topRightHandle.anchors.top = undefined; | topRightHandle.anchors.top = undefined; | |||
skipping to change at line 427 | skipping to change at line 431 | |||
drag.target: parent | drag.target: parent | |||
onEntered: { | onEntered: { | |||
rectangle.anchors.top = parent.top; | rectangle.anchors.top = parent.top; | |||
topLeftHandle.anchors.top = rectangle.top; | topLeftHandle.anchors.top = rectangle.top; | |||
topRightHandle.anchors.top = rectangle.top; | topRightHandle.anchors.top = rectangle.top; | |||
leftHandle.anchors.verticalCenter = rectangle.verticalCenter; | leftHandle.anchors.verticalCenter = rectangle.verticalCenter; | |||
rightHandle.anchors.verticalCenter = rectangle.verticalCenter; | rightHandle.anchors.verticalCenter = rectangle.verticalCenter; | |||
} | } | |||
onPositionChanged: { | onPositionChanged: { | |||
topHandle.x = topLeftHandle.x + rectangle.width / 2 - (handleSiz e / 2); | topHandle.x = topLeftHandle.x + rectangle.width / 2 - (handleSiz e / 2); | |||
topHandle.y = snapY(topHandle.y); | if (!(mouse.modifiers & Qt.AltModifier)) | |||
topHandle.y = snapY(topHandle.y); | ||||
parent.x = Math.min(parent.x, bottomHandle.x); | parent.x = Math.min(parent.x, bottomHandle.x); | |||
parent.y = Math.min(parent.y, bottomHandle.y); | parent.y = Math.min(parent.y, bottomHandle.y); | |||
rectChanged(rectangle); | rectChanged(rectangle); | |||
} | } | |||
onReleased: { | onReleased: { | |||
rectChanged(rectangle); | rectChanged(rectangle); | |||
topLeftHandle.anchors.top = undefined; | topLeftHandle.anchors.top = undefined; | |||
topRightHandle.anchors.top = undefined; | topRightHandle.anchors.top = undefined; | |||
leftHandle.anchors.verticalCenter = undefined; | leftHandle.anchors.verticalCenter = undefined; | |||
rightHandle.anchors.verticalCenter = undefined; | rightHandle.anchors.verticalCenter = undefined; | |||
skipping to change at line 465 | skipping to change at line 471 | |||
drag.target: parent | drag.target: parent | |||
onEntered: { | onEntered: { | |||
rectangle.anchors.bottom = parent.bottom; | rectangle.anchors.bottom = parent.bottom; | |||
bottomLeftHandle.anchors.bottom = rectangle.bottom; | bottomLeftHandle.anchors.bottom = rectangle.bottom; | |||
bottomRightHandle.anchors.bottom = rectangle.bottom; | bottomRightHandle.anchors.bottom = rectangle.bottom; | |||
leftHandle.anchors.verticalCenter = rectangle.verticalCenter; | leftHandle.anchors.verticalCenter = rectangle.verticalCenter; | |||
rightHandle.anchors.verticalCenter = rectangle.verticalCenter; | rightHandle.anchors.verticalCenter = rectangle.verticalCenter; | |||
} | } | |||
onPositionChanged: { | onPositionChanged: { | |||
bottomHandle.x = topLeftHandle.x + rectangle.width / 2 - (handle Size / 2); | bottomHandle.x = topLeftHandle.x + rectangle.width / 2 - (handle Size / 2); | |||
bottomHandle.y = snapY(bottomHandle.y + handleSize) - handleSize | if (!(mouse.modifiers & Qt.AltModifier)) | |||
; | bottomHandle.y = snapY(bottomHandle.y + handleSize) - handle | |||
Size; | ||||
parent.x = Math.max(parent.x, topHandle.x); | parent.x = Math.max(parent.x, topHandle.x); | |||
parent.y = Math.max(parent.y, topHandle.y); | parent.y = Math.max(parent.y, topHandle.y); | |||
rectChanged(rectangle); | rectChanged(rectangle); | |||
} | } | |||
onReleased: { | onReleased: { | |||
rectChanged(rectangle); | rectChanged(rectangle); | |||
bottomLeftHandle.anchors.bottom = undefined; | bottomLeftHandle.anchors.bottom = undefined; | |||
bottomRightHandle.anchors.bottom = undefined; | bottomRightHandle.anchors.bottom = undefined; | |||
leftHandle.anchors.verticalCenter = undefined; | leftHandle.anchors.verticalCenter = undefined; | |||
rightHandle.anchors.verticalCenter = undefined; | rightHandle.anchors.verticalCenter = undefined; | |||
skipping to change at line 502 | skipping to change at line 510 | |||
cursorShape: Qt.SizeHorCursor | cursorShape: Qt.SizeHorCursor | |||
drag.target: parent | drag.target: parent | |||
onEntered: { | onEntered: { | |||
rectangle.anchors.left = parent.left; | rectangle.anchors.left = parent.left; | |||
topLeftHandle.anchors.left = rectangle.left; | topLeftHandle.anchors.left = rectangle.left; | |||
bottomLeftHandle.anchors.left = rectangle.left; | bottomLeftHandle.anchors.left = rectangle.left; | |||
topHandle.anchors.horizontalCenter = rectangle.horizontalCenter; | topHandle.anchors.horizontalCenter = rectangle.horizontalCenter; | |||
bottomHandle.anchors.horizontalCenter = rectangle.horizontalCent er; | bottomHandle.anchors.horizontalCenter = rectangle.horizontalCent er; | |||
} | } | |||
onPositionChanged: { | onPositionChanged: { | |||
leftHandle.x = snapX(leftHandle.x); | if (!(mouse.modifiers & Qt.AltModifier)) | |||
leftHandle.x = snapX(leftHandle.x); | ||||
leftHandle.y = topLeftHandle.y + rectangle.height / 2 - (handleS ize / 2); | leftHandle.y = topLeftHandle.y + rectangle.height / 2 - (handleS ize / 2); | |||
parent.x = Math.min(parent.x, rightHandle.x); | parent.x = Math.min(parent.x, rightHandle.x); | |||
parent.y = Math.min(parent.y, rightHandle.y); | parent.y = Math.min(parent.y, rightHandle.y); | |||
rectChanged(rectangle); | rectChanged(rectangle); | |||
} | } | |||
onReleased: { | onReleased: { | |||
rectChanged(rectangle); | rectChanged(rectangle); | |||
topLeftHandle.anchors.left = undefined; | topLeftHandle.anchors.left = undefined; | |||
bottomLeftHandle.anchors.left = undefined; | bottomLeftHandle.anchors.left = undefined; | |||
topHandle.anchors.horizontalCenter = undefined; | topHandle.anchors.horizontalCenter = undefined; | |||
skipping to change at line 540 | skipping to change at line 550 | |||
cursorShape: Qt.SizeHorCursor | cursorShape: Qt.SizeHorCursor | |||
drag.target: parent | drag.target: parent | |||
onEntered: { | onEntered: { | |||
rectangle.anchors.right = parent.right; | rectangle.anchors.right = parent.right; | |||
topRightHandle.anchors.right = rectangle.right; | topRightHandle.anchors.right = rectangle.right; | |||
bottomRightHandle.anchors.right = rectangle.right; | bottomRightHandle.anchors.right = rectangle.right; | |||
topHandle.anchors.horizontalCenter = rectangle.horizontalCenter; | topHandle.anchors.horizontalCenter = rectangle.horizontalCenter; | |||
bottomHandle.anchors.horizontalCenter = rectangle.horizontalCent er; | bottomHandle.anchors.horizontalCenter = rectangle.horizontalCent er; | |||
} | } | |||
onPositionChanged: { | onPositionChanged: { | |||
rightHandle.x = snapX(rightHandle.x + handleSize) - handleSize; | if (!(mouse.modifiers & Qt.AltModifier)) | |||
rightHandle.x = snapX(rightHandle.x + handleSize) - handleSi | ||||
ze; | ||||
rightHandle.y = topLeftHandle.y + rectangle.height / 2 - (handle Size / 2); | rightHandle.y = topLeftHandle.y + rectangle.height / 2 - (handle Size / 2); | |||
parent.x = Math.max(parent.x, leftHandle.x); | parent.x = Math.max(parent.x, leftHandle.x); | |||
parent.y = Math.max(parent.y, leftHandle.y); | parent.y = Math.max(parent.y, leftHandle.y); | |||
rectChanged(rectangle); | rectChanged(rectangle); | |||
} | } | |||
onReleased: { | onReleased: { | |||
rectChanged(rectangle); | rectChanged(rectangle); | |||
topRightHandle.anchors.right = undefined; | topRightHandle.anchors.right = undefined; | |||
bottomRightHandle.anchors.right = undefined; | bottomRightHandle.anchors.right = undefined; | |||
topHandle.anchors.horizontalCenter = undefined; | topHandle.anchors.horizontalCenter = undefined; | |||
skipping to change at line 587 | skipping to change at line 599 | |||
topHandle.anchors.horizontalCenter = rectangle.horizontalCenter; | topHandle.anchors.horizontalCenter = rectangle.horizontalCenter; | |||
topHandle.anchors.top = rectangle.top; | topHandle.anchors.top = rectangle.top; | |||
bottomHandle.anchors.horizontalCenter = rectangle.horizontalCent er; | bottomHandle.anchors.horizontalCenter = rectangle.horizontalCent er; | |||
bottomHandle.anchors.bottom = rectangle.bottom; | bottomHandle.anchors.bottom = rectangle.bottom; | |||
leftHandle.anchors.verticalCenter = rectangle.verticalCenter; | leftHandle.anchors.verticalCenter = rectangle.verticalCenter; | |||
leftHandle.anchors.left = rectangle.left; | leftHandle.anchors.left = rectangle.left; | |||
rightHandle.anchors.verticalCenter = rectangle.verticalCenter; | rightHandle.anchors.verticalCenter = rectangle.verticalCenter; | |||
rightHandle.anchors.right = rectangle.right; | rightHandle.anchors.right = rectangle.right; | |||
} | } | |||
onPositionChanged: { | onPositionChanged: { | |||
topRightHandle.x = snapX(topRightHandle.x + handleSize) - handle | if (!(mouse.modifiers & Qt.AltModifier)) { | |||
Size; | topRightHandle.x = snapX(topRightHandle.x + handleSize) - ha | |||
topRightHandle.y = snapY(topRightHandle.y); | ndleSize; | |||
topRightHandle.y = snapY(topRightHandle.y); | ||||
} | ||||
if (aspectRatio !== 0) | if (aspectRatio !== 0) | |||
parent.x = topLeftHandle.x + rectangle.height * aspectRatio - handleSize; | parent.x = topLeftHandle.x + rectangle.height * aspectRatio - handleSize; | |||
parent.x = Math.max(parent.x, bottomLeftHandle.x); | parent.x = Math.max(parent.x, bottomLeftHandle.x); | |||
parent.y = Math.min(parent.y, bottomLeftHandle.y); | parent.y = Math.min(parent.y, bottomLeftHandle.y); | |||
rectChanged(rectangle); | rectChanged(rectangle); | |||
} | } | |||
onReleased: { | onReleased: { | |||
rectChanged(rectangle); | rectChanged(rectangle); | |||
topLeftHandle.anchors.top = undefined; | topLeftHandle.anchors.top = undefined; | |||
skipping to change at line 643 | skipping to change at line 657 | |||
topHandle.anchors.horizontalCenter = rectangle.horizontalCenter; | topHandle.anchors.horizontalCenter = rectangle.horizontalCenter; | |||
topHandle.anchors.top = rectangle.top; | topHandle.anchors.top = rectangle.top; | |||
bottomHandle.anchors.horizontalCenter = rectangle.horizontalCent er; | bottomHandle.anchors.horizontalCenter = rectangle.horizontalCent er; | |||
bottomHandle.anchors.bottom = rectangle.bottom; | bottomHandle.anchors.bottom = rectangle.bottom; | |||
leftHandle.anchors.verticalCenter = rectangle.verticalCenter; | leftHandle.anchors.verticalCenter = rectangle.verticalCenter; | |||
leftHandle.anchors.left = rectangle.left; | leftHandle.anchors.left = rectangle.left; | |||
rightHandle.anchors.verticalCenter = rectangle.verticalCenter; | rightHandle.anchors.verticalCenter = rectangle.verticalCenter; | |||
rightHandle.anchors.right = rectangle.right; | rightHandle.anchors.right = rectangle.right; | |||
} | } | |||
onPositionChanged: { | onPositionChanged: { | |||
bottomLeftHandle.x = snapX(bottomLeftHandle.x); | if (!(mouse.modifiers & Qt.AltModifier)) { | |||
bottomLeftHandle.y = snapY(bottomLeftHandle.y + handleSize) - ha | bottomLeftHandle.x = snapX(bottomLeftHandle.x); | |||
ndleSize; | bottomLeftHandle.y = snapY(bottomLeftHandle.y + handleSize) | |||
- handleSize; | ||||
} | ||||
if (aspectRatio !== 0) | if (aspectRatio !== 0) | |||
parent.x = topRightHandle.x + handleSize - rectangle.height * aspectRatio; | parent.x = topRightHandle.x + handleSize - rectangle.height * aspectRatio; | |||
parent.x = Math.min(parent.x, topRightHandle.x); | parent.x = Math.min(parent.x, topRightHandle.x); | |||
parent.y = Math.max(parent.y, topRightHandle.y); | parent.y = Math.max(parent.y, topRightHandle.y); | |||
rectChanged(rectangle); | rectChanged(rectangle); | |||
} | } | |||
onReleased: { | onReleased: { | |||
rectChanged(rectangle); | rectChanged(rectangle); | |||
topLeftHandle.anchors.left = undefined; | topLeftHandle.anchors.left = undefined; | |||
skipping to change at line 697 | skipping to change at line 713 | |||
topHandle.anchors.horizontalCenter = rectangle.horizontalCenter; | topHandle.anchors.horizontalCenter = rectangle.horizontalCenter; | |||
topHandle.anchors.top = rectangle.top; | topHandle.anchors.top = rectangle.top; | |||
bottomHandle.anchors.horizontalCenter = rectangle.horizontalCent er; | bottomHandle.anchors.horizontalCenter = rectangle.horizontalCent er; | |||
bottomHandle.anchors.bottom = rectangle.bottom; | bottomHandle.anchors.bottom = rectangle.bottom; | |||
leftHandle.anchors.verticalCenter = rectangle.verticalCenter; | leftHandle.anchors.verticalCenter = rectangle.verticalCenter; | |||
leftHandle.anchors.left = rectangle.left; | leftHandle.anchors.left = rectangle.left; | |||
rightHandle.anchors.verticalCenter = rectangle.verticalCenter; | rightHandle.anchors.verticalCenter = rectangle.verticalCenter; | |||
rightHandle.anchors.right = rectangle.right; | rightHandle.anchors.right = rectangle.right; | |||
} | } | |||
onPositionChanged: { | onPositionChanged: { | |||
bottomRightHandle.x = snapX(bottomRightHandle.x + handleSize) - | if (!(mouse.modifiers & Qt.AltModifier)) { | |||
handleSize; | bottomRightHandle.x = snapX(bottomRightHandle.x + handleSize | |||
bottomRightHandle.y = snapY(bottomRightHandle.y + handleSize) - | ) - handleSize; | |||
handleSize; | bottomRightHandle.y = snapY(bottomRightHandle.y + handleSize | |||
) - handleSize; | ||||
} | ||||
if (aspectRatio !== 0) | if (aspectRatio !== 0) | |||
parent.x = topLeftHandle.x + rectangle.height * aspectRatio - handleSize; | parent.x = topLeftHandle.x + rectangle.height * aspectRatio - handleSize; | |||
parent.x = Math.max(parent.x, topLeftHandle.x); | parent.x = Math.max(parent.x, topLeftHandle.x); | |||
parent.y = Math.max(parent.y, topLeftHandle.y); | parent.y = Math.max(parent.y, topLeftHandle.y); | |||
rectChanged(rectangle); | rectChanged(rectangle); | |||
} | } | |||
onReleased: { | onReleased: { | |||
rectChanged(rectangle); | rectChanged(rectangle); | |||
topRightHandle.anchors.right = undefined; | topRightHandle.anchors.right = undefined; | |||
End of changes. 9 change blocks. | ||||
21 lines changed or deleted | 40 lines changed or added |