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

Ensure internal effects like subtitles stay on top so that they are not...

Ensure internal effects like subtitles stay on top so that they are not affected by color or transform effects.
Fixes #1438
parent d9a9c00d
......@@ -876,6 +876,24 @@ void EffectStackModel::registerItem(const std::shared_ptr<TreeItem> &item)
if (!m_loadingExisting) {
// qDebug() << "$$$$$$$$$$$$$$$$$$$$$ Planting effect in " << m_childServices.size();
effectItem->plant(m_masterService);
// Check if we have an internal effect that needs to stay on top
if (m_ownerId.first == ObjectType::Master || m_ownerId.first == ObjectType::TimelineTrack) {
// check for subtitle effect
auto ms = m_masterService.lock();
int ct = ms->filter_count();
QVector <int> ixToMove;
for (int i = 0; i < ct; i++) {
if (ms->filter(i)->get_int("internal_added") > 0) {
ixToMove << i;
}
}
std::sort(ixToMove.rbegin(), ixToMove.rend());
for (auto &ix : ixToMove) {
if (ix < ct - 1) {
ms->move_filter(ix, ct - 1);
}
}
}
for (const auto &service : m_childServices) {
// qDebug() << "$$$$$$$$$$$$$$$$$$$$$ Planting CLONE effect in " << (void *)service.lock().get();
effectItem->plantClone(service);
......
Supports Markdown
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