Fix clip fade in cannot be 1 frame

parent e2af84a9
Pipeline #1538 passed with stage
in 20 minutes and 19 seconds
......@@ -514,7 +514,6 @@ bool EffectStackModel::adjustFadeLength(int duration, bool fromStart, bool audio
if (ptr) {
in = ptr->get_int("in");
}
qDebug() << "//// SETTING CLIP FADIN: " << duration;
int oldDuration = -1;
for (int i = 0; i < rootItem->childCount(); ++i) {
if (m_fadeIns.count(std::static_pointer_cast<TreeItem>(rootItem->child(i))->getId()) > 0) {
......@@ -597,7 +596,7 @@ int EffectStackModel::getFadePosition(bool fromStart)
for (int i = 0; i < rootItem->childCount(); ++i) {
if (*(m_fadeIns.begin()) == std::static_pointer_cast<TreeItem>(rootItem->child(i))->getId()) {
std::shared_ptr<EffectItemModel> effect = std::static_pointer_cast<EffectItemModel>(rootItem->child(i));
return effect->filter().get_length();
return effect->filter().get_length() - 1;
}
}
} else {
......
......@@ -582,15 +582,15 @@ Rectangle {
else
parent.anchors.left = fadeInTriangle.left
console.log('released fade: ', clipRoot.fadeIn)
timeline.adjustFade(clipRoot.clipId, 'fadein', clipRoot.fadeIn - 1, startFadeIn)
timeline.adjustFade(clipRoot.clipId, 'fadein', clipRoot.fadeIn, startFadeIn)
bubbleHelp.hide()
}
onPositionChanged: {
if (mouse.buttons === Qt.LeftButton) {
var delta = Math.round(parent.x / timeScale) - startX
var duration = Math.max(0, startFadeIn + delta - 1)
var duration = Math.max(0, startFadeIn + delta)
duration = Math.min(duration, clipRoot.clipDuration)
if (duration != clipRoot.fadeIn - 1) {
if (duration != clipRoot.fadeIn) {
timeline.adjustFade(clipRoot.clipId, 'fadein', duration, -1)
// Show fade duration as time in a "bubble" help.
var s = timeline.timecode(Math.max(duration, 0))
......
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