Commit 2ee142a6 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 a238866f
Pipeline #81460 passed with stage
in 9 minutes and 47 seconds
...@@ -163,7 +163,8 @@ void AssetPanel::showTransition(int tid, const std::shared_ptr<AssetParameterMod ...@@ -163,7 +163,8 @@ void AssetPanel::showTransition(int tid, const std::shared_ptr<AssetParameterMod
m_transitionWidget->setVisible(true); m_transitionWidget->setVisible(true);
m_timelineButton->setVisible(true); m_timelineButton->setVisible(true);
m_enableStackButton->setVisible(false); 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) void AssetPanel::showMix(int cid, const std::shared_ptr<AssetParameterModel> &transitionModel)
......
...@@ -511,6 +511,11 @@ void Core::refreshProjectRange(QPair<int, int> range) ...@@ -511,6 +511,11 @@ void Core::refreshProjectRange(QPair<int, int> range)
m_monitorManager->refreshProjectRange(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) int Core::getItemPosition(const ObjectId &id)
{ {
if (!m_guiConstructed) return 0; if (!m_guiConstructed) return 0;
......
...@@ -263,6 +263,8 @@ public: ...@@ -263,6 +263,8 @@ public:
* @param configFile configuration file for KNewStuff * @param configFile configuration file for KNewStuff
* @return number of installed items */ * @return number of installed items */
int getNewStuff(const QString &configFile); int getNewStuff(const QString &configFile);
/** @brief Get the frame size of the clip above a composition */
const QSize getCompositionSizeOnTrack(const ObjectId &id);
private: private:
explicit Core(); explicit Core();
......
...@@ -5606,3 +5606,14 @@ QVariantList TimelineModel::getMasterEffectZones() const ...@@ -5606,3 +5606,14 @@ QVariantList TimelineModel::getMasterEffectZones() const
} }
return {}; 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();
}
...@@ -751,6 +751,8 @@ public: ...@@ -751,6 +751,8 @@ public:
void requestResizeMix(int cid, int duration, MixAlignment align); void requestResizeMix(int cid, int duration, MixAlignment align);
MixAlignment getMixAlign(int cid) const; MixAlignment getMixAlign(int cid) const;
std::shared_ptr<SubtitleModel> getSubtitleModel(); std::shared_ptr<SubtitleModel> getSubtitleModel();
/** @brief Get the frame size of the clip above a composition */
const QSize getCompositionSizeOnTrack(const ObjectId &id);
protected: protected:
/** @brief Register a new track. This is a call-back meant to be called from TrackModel /** @brief Register a new track. This is a call-back meant to be called from TrackModel
......
  • check it again code: because i'm testing this, little bug: my image scale real 6993 i try move out of video (over of x-1 image is off..)...

    Edited by manuel muzzurru
  • this little bug is for "composite and transform", instead transform/composite are work..

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