Fix item resize dialog working incorrectly

parent cfd871e9
......@@ -269,7 +269,7 @@ Rectangle {
controller.requestClipMove(clipRoot.clipId, controller.getPreviousTrackId(clipRoot.trackId), clipRoot.modelStart, true, true, true);
}
onPositionChanged: {
if (pressed && mouse.buttons === Qt.LeftButton) {
if (pressed && mouse.buttons === Qt.LeftButton && drag.target != undefined) {
var trackIndex = Logic.getTrackIndexFromId(clipRoot.trackId)
if ((mouse.y < 0 && trackIndex > 0) || (mouse.y > height && trackIndex < tracksRepeater.count - 1)) {
var mapped = parentTrack.mapFromItem(clipRoot, mouse.x, mouse.y).x
......@@ -281,7 +281,7 @@ Rectangle {
}
onReleased: {
root.stopScrolling = false
if (mouse.button == Qt.LeftButton) {
if (mouse.button == Qt.LeftButton && drag.target != undefined) {
var delta = clipRoot.x - startX
drag.target = undefined
cursorShape = Qt.OpenHandCursor
......@@ -299,6 +299,7 @@ Rectangle {
}
}
onDoubleClicked: {
drag.target = undefined
if (mouse.modifiers & Qt.ShiftModifier) {
if (keyframeModel && showKeyframes) {
// Add new keyframe
......@@ -311,7 +312,6 @@ Rectangle {
} else {
timeline.editItemDuration(clipId)
}
drag.target = undefined
}
onWheel: zoomByWheel(wheel)
}
......
......@@ -1621,7 +1621,7 @@ void TimelineController::editItemDuration(int id)
}
}
int trackId = m_model->getItemTrackId(id);
int maxFrame = m_model->getTrackById(trackId)->getBlankSizeNearClip(id, true);
int maxFrame = start + duration + m_model->getTrackById(trackId)->getBlankSizeNearClip(id, true);
int minFrame = in - m_model->getTrackById(trackId)->getBlankSizeNearClip(id, false);
int partner = m_model->getClipSplitPartner(id);
QPointer<ClipDurationDialog> dialog =
......@@ -1663,9 +1663,9 @@ void TimelineController::editItemDuration(int id)
}
}
if (newDuration != duration + (in - newIn)) {
result = result && m_model->requestItemResize(id, newDuration, false, true, undo, redo);
result = result && m_model->requestItemResize(id, newDuration, start == newPos, true, undo, redo);
if (result && partner > -1) {
result = m_model->requestItemResize(partner, newDuration, false, true, undo, redo);
result = m_model->requestItemResize(partner, newDuration, start == newPos, true, undo, redo);
}
}
if (start != newPos || newIn != in) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment