Commit a5472db7 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix master effect zones hidden in recent change, ensure moving a zone with...

Fix master effect zones hidden in recent change, ensure moving a zone with mouse always sticks to frames
Related to #990
parent da2ec73d
...@@ -244,6 +244,20 @@ Item { ...@@ -244,6 +244,20 @@ Item {
timeline.updateZone(start, end, update) timeline.updateZone(start, end, update)
} }
} }
// Master effect zones
Repeater {
model: effectZones
Rectangle {
x: effectZones[index].x * timeline.scaleFactor
height: Math.ceil(zoneHeight/4)
width: (effectZones[index].y - effectZones[index].x) * timeline.scaleFactor
color: "blueviolet"
anchors.bottom: parent.bottom
anchors.bottomMargin: zoneHeight - height - 1
}
}
// Effect zone // Effect zone
RulerZone { RulerZone {
id: effectZone id: effectZone
...@@ -257,24 +271,13 @@ Item { ...@@ -257,24 +271,13 @@ Item {
property: "frameOut" property: "frameOut"
value: timeline.effectZone.y value: timeline.effectZone.y
} }
color: Qt.rgba(148, 0, 211,0.7) color: "orchid"
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
height: zoneHeight height: zoneHeight - 1
function updateZone(start, end, update) function updateZone(start, end, update)
{ {
timeline.updateEffectZone(start, end, update) timeline.updateEffectZone(start, end, update)
} }
} }
Repeater {
model: effectZones
Rectangle {
x: effectZones[index].x * timeline.scaleFactor
height: 2
width: (effectZones[index].y - effectZones[index].x) * timeline.scaleFactor
color: 'blueviolet'
opacity: 0.8
anchors.bottom: parent.bottom
}
}
} }
...@@ -55,14 +55,17 @@ Rectangle { ...@@ -55,14 +55,17 @@ Rectangle {
Drag.proposedAction: Qt.MoveAction Drag.proposedAction: Qt.MoveAction
MouseArea { MouseArea {
id: moveMouseArea id: moveMouseArea
anchors.fill: parent anchors.left: parent.left
anchors.top: parent.top
width: parent.width
height: parent.height
hoverEnabled: true hoverEnabled: true
drag.target: rzone
drag.axis: Drag.XAxis drag.axis: Drag.XAxis
drag.smoothed: false drag.smoothed: false
property var startZone property var startZone
onPressed: { onPressed: {
startZone = Qt.point(frameIn, frameOut) startZone = Qt.point(frameIn, frameOut)
anchors.left= undefined
} }
onEntered: { onEntered: {
resizeActive = true resizeActive = true
...@@ -73,11 +76,12 @@ Rectangle { ...@@ -73,11 +76,12 @@ Rectangle {
onReleased: { onReleased: {
updateZone(startZone, Qt.point(frameIn, frameOut), true) updateZone(startZone, Qt.point(frameIn, frameOut), true)
resizeActive = false resizeActive = false
anchors.left= parent.left
} }
onPositionChanged: { onPositionChanged: {
if (mouse.buttons === Qt.LeftButton) { if (mouse.buttons === Qt.LeftButton) {
resizeActive = true resizeActive = true
var offset = Math.round(rzone.x/ timeline.scaleFactor) - frameIn var offset = Math.round(mouseX/ timeline.scaleFactor)
if (offset != 0) { if (offset != 0) {
var newPos = Math.max(0, controller.suggestSnapPoint(frameIn + offset,root.snapping)) var newPos = Math.max(0, controller.suggestSnapPoint(frameIn + offset,root.snapping))
frameOut += newPos - frameIn frameOut += newPos - frameIn
......
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