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 {
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
RulerZone {
id: effectZone
......@@ -257,24 +271,13 @@ Item {
property: "frameOut"
value: timeline.effectZone.y
}
color: Qt.rgba(148, 0, 211,0.7)
color: "orchid"
anchors.bottom: parent.bottom
height: zoneHeight
height: zoneHeight - 1
function updateZone(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 {
Drag.proposedAction: Qt.MoveAction
MouseArea {
id: moveMouseArea
anchors.fill: parent
anchors.left: parent.left
anchors.top: parent.top
width: parent.width
height: parent.height
hoverEnabled: true
drag.target: rzone
drag.axis: Drag.XAxis
drag.smoothed: false
property var startZone
onPressed: {
startZone = Qt.point(frameIn, frameOut)
anchors.left= undefined
}
onEntered: {
resizeActive = true
......@@ -73,11 +76,12 @@ Rectangle {
onReleased: {
updateZone(startZone, Qt.point(frameIn, frameOut), true)
resizeActive = false
anchors.left= parent.left
}
onPositionChanged: {
if (mouse.buttons === Qt.LeftButton) {
resizeActive = true
var offset = Math.round(rzone.x/ timeline.scaleFactor) - frameIn
var offset = Math.round(mouseX/ timeline.scaleFactor)
if (offset != 0) {
var newPos = Math.max(0, controller.suggestSnapPoint(frameIn + offset,root.snapping))
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