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

Fix adjust to frame size option in transform/position & zoom compositions.

Related to #1193
parent d9af07d0
......@@ -168,7 +168,8 @@ void AssetPanel::showTransition(int tid, const std::shared_ptr<AssetParameterMod
m_transitionWidget->setVisible(true);
m_timelineButton->setVisible(true);
m_enableStackButton->setVisible(false);
m_transitionWidget->setModel(transitionModel, QSize(), true);
QSize s = pCore->getCompositionSizeOnTrack(id);
m_transitionWidget->setModel(transitionModel, s, true);
}
void AssetPanel::showMix(int cid, const std::shared_ptr<AssetParameterModel> &transitionModel)
......
......@@ -469,6 +469,11 @@ void Core::refreshProjectRange(QPair<int, int> range)
m_monitorManager->refreshProjectRange(range);
}
const QSize Core::getCompositionSizeOnTrack(const ObjectId &id)
{
return m_mainWindow->getCurrentTimeline()->controller()->getModel()->getCompositionSizeOnTrack(id);
}
int Core::getItemPosition(const ObjectId &id)
{
if (!m_guiConstructed) return 0;
......
......@@ -264,6 +264,8 @@ public:
MixAlignment getMixAlign(int cid) const;
/** @brief Closing current document, do some cleanup */
void cleanup();
/** @brief Get the frame size of the clip above a composition */
const QSize getCompositionSizeOnTrack(const ObjectId &id);
private:
explicit Core();
......
......@@ -5512,3 +5512,14 @@ QVariantList TimelineModel::getMasterEffectZones() const
}
return {};
}
const QSize TimelineModel::getCompositionSizeOnTrack(const ObjectId &id)
{
int pos = getCompositionPosition(id.second);
int tid = getCompositionTrackId(id.second);
int cid = getTrackById_const(tid)->getClipByPosition(pos);
if (cid > -1) {
return getClipFrameSize(cid);
}
return QSize();
}
......@@ -746,6 +746,8 @@ public:
void requestResizeMix(int cid, int duration, MixAlignment align);
MixAlignment getMixAlign(int cid) const;
std::shared_ptr<SubtitleModel> getSubtitleModel();
/** @brief Get the frame size of the clip above a composition */
const QSize getCompositionSizeOnTrack(const ObjectId &id);
protected:
/** @brief Register a new track. This is a call-back meant to be called from TrackModel
......
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