"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/qml/filters/size_position/SizePositionVUI.qml" between
shotcut-20.09.01.tar.gz and shotcut-20.09.13.tar.gz

About: Shotcut is a cross-platform (Qt) advanced video editor.

SizePositionVUI.qml  (shotcut-20.09.01):SizePositionVUI.qml  (shotcut-20.09.13)
skipping to change at line 148 skipping to change at line 148
var rightX = filterRect.x + filterRect.width var rightX = filterRect.x + filterRect.width
filterRect.width = (profile.width * scale) filterRect.width = (profile.width * scale)
if (align === 'center' || align === 'middle') { if (align === 'center' || align === 'middle') {
filterRect.x = centerX - filterRect.width / 2 filterRect.x = centerX - filterRect.width / 2
} else if (align === 'right') { } else if (align === 'right') {
filterRect.x = rightX - filterRect.width filterRect.x = rightX - filterRect.width
} }
var middleY = filterRect.y + filterRect.height / 2 var middleY = filterRect.y + filterRect.height / 2
var bottomY = filterRect.y + filterRect.height var bottomY = filterRect.y + filterRect.height
align = filter.get(valignProperty) align = filter.get(valignProperty)
filterRect.height = (profile.height * scale) filterRect.height = Math.round(filterRect.width / rectangle.aspectRa tio)
if (align === 'center' || align === 'middle') { if (align === 'center' || align === 'middle') {
filterRect.y = middleY - filterRect.height / 2 filterRect.y = middleY - filterRect.height / 2
} else if (align === 'bottom') { } else if (align === 'bottom') {
filterRect.y = bottomY - filterRect.height filterRect.y = bottomY - filterRect.height
} }
rectangle.setHandles(filterRect) rectangle.setHandles(filterRect)
setFilter(getPosition()) setFilter(getPosition())
} }
} }
function isFillMode() { function isFillMode() {
return filter.get(fillProperty) === '1' && filter.get(distortProperty) ! == '1' return filter.get(fillProperty) === '1' && filter.get(distortProperty) ! == '1'
} }
function snapRotation(degrees, strength) {
if ((Math.abs(degrees) + strength) % 90 < strength * 2) {
degrees = Math.round(degrees / 90) * 90
}
return degrees
}
PinchArea { PinchArea {
anchors.fill: parent anchors.fill: parent
pinch.minimumRotation: -360 pinch.minimumRotation: -360
pinch.maximumRotation: 360 pinch.maximumRotation: 360
pinch.minimumScale: 0.1 pinch.minimumScale: 0.1
pinch.maximumScale: 10 pinch.maximumScale: 10
property real currentScale: 1 property real currentScale: 1
property real currentRotation: 0 property real currentRotation: 0
property bool noModifiers: true property bool noModifiers: true
Keys.onPressed: { Keys.onPressed: {
skipping to change at line 185 skipping to change at line 192
Keys.onReleased: { Keys.onReleased: {
noModifiers = event.modifiers === Qt.NoModifier noModifiers = event.modifiers === Qt.NoModifier
} }
onPinchStarted: { onPinchStarted: {
currentRotation = rectangle.rotation currentRotation = rectangle.rotation
currentScale = filterRect.width / profile.width currentScale = filterRect.width / profile.width
} }
onPinchUpdated: if (noModifiers) { onPinchUpdated: if (noModifiers) {
if (rotationProperty && Math.abs(pinch.rotation - 0) > 0.01) { if (rotationProperty && Math.abs(pinch.rotation - 0) > 0.01) {
var degrees = currentRotation + pinch.rotation var degrees = currentRotation + pinch.rotation
if (Math.abs(degrees % 90) < 10) rectangle.rotation = snapRotation(degrees, 4)
degrees = Math.round(rectangle.rotation / 90) * 90
rectangle.rotation = degrees
blockUpdate = true blockUpdate = true
updateRotation(rectangle.rotation % 360) updateRotation(rectangle.rotation % 360)
blockUpdate = false blockUpdate = false
} }
// Pinch zoom conflicts too much with mouse wheel // Pinch zoom conflicts too much with mouse wheel
// if (!blockUpdate && isFillMode()) { // if (!blockUpdate && isFillMode()) {
// var scale = currentScale + (pinch.scale - 2) / 3 // var scale = currentScale + (pinch.scale - 2) / 3
// if (Math.abs(scale - 1.0) < 0.05) // if (Math.abs(scale - 1.0) < 0.05)
// scale = 1.0 // scale = 1.0
// updateScale(Math.min(scale, 10)) // updateScale(Math.min(scale, 10))
// } // }
} }
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
acceptedButtons: Qt.NoButton acceptedButtons: Qt.NoButton
scrollGestureEnabled: true scrollGestureEnabled: true
onWheel: { onWheel: {
if (rotationProperty && (wheel.modifiers & Qt.ControlModifier)) { if (rotationProperty && (wheel.modifiers & Qt.ControlModifier)) {
var degrees = rectangle.rotation - wheel.angleDelta.y / 120 * 5 var degrees = rectangle.rotation - wheel.angleDelta.y / 120 * 5
if (Math.abs(degrees % 90) < 2) if (!(wheel.modifiers & Qt.AltModifier)) {
degrees = Math.round(rectangle.rotation / 90) * 90 degrees = snapRotation(degrees, 1.5)
}
rectangle.rotation = degrees rectangle.rotation = degrees
blockUpdate = true blockUpdate = true
updateRotation(rectangle.rotation % 360) updateRotation(rectangle.rotation % 360)
blockUpdate = false blockUpdate = false
} else if (!blockUpdate && isFillMode()) { } else if (!blockUpdate && isFillMode()) {
var scale = filterRect.width / profile.width var scale = filterRect.width / profile.width
scale += wheel.angleDelta.y / 120 / 10 scale += wheel.angleDelta.y / 120 / 10
updateScale(Math.min(scale, 10)) updateScale(Math.min(scale, 10))
} }
} }
skipping to change at line 250 skipping to change at line 256
id: rectangle id: rectangle
withRotation: !!rotationProperty withRotation: !!rotationProperty
widthScale: video.rect.width / profile.width widthScale: video.rect.width / profile.width
heightScale: video.rect.height / profile.height heightScale: video.rect.height / profile.height
handleSize: Math.max(Math.round(8 / zoom), 4) handleSize: Math.max(Math.round(8 / zoom), 4)
borderSize: Math.max(Math.round(1.33 / zoom), 1) borderSize: Math.max(Math.round(1.33 / zoom), 1)
onWidthScaleChanged: setHandles(filterRect) onWidthScaleChanged: setHandles(filterRect)
onHeightScaleChanged: setHandles(filterRect) onHeightScaleChanged: setHandles(filterRect)
onRectChanged: setFilter(getPosition()) onRectChanged: setFilter(getPosition())
onRotated: { onRotated: {
if (!(mouse.modifiers & Qt.AltModifier)) {
degrees = snapRotation(degrees, 4) % 360
}
blockUpdate = true blockUpdate = true
updateRotation(degrees % 360) updateRotation(degrees)
blockUpdate = false blockUpdate = false
} }
onRotationReleased: {
rectangle.rotation = filter.getDouble(rotationProperty, getP
osition())
}
} }
} }
} }
Connections { Connections {
target: filter target: filter
onChanged: { onChanged: {
setRectangleControl() setRectangleControl()
if (rectangle.aspectRatio !== getAspectRatio()) { if (rectangle.aspectRatio !== getAspectRatio()) {
rectangle.aspectRatio = getAspectRatio() rectangle.aspectRatio = getAspectRatio()
 End of changes. 7 change blocks. 
7 lines changed or deleted 20 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)