added length field for transitions

This commit is contained in:
itsmattkc
2018-11-25 09:44:16 +11:00
parent 7d11c9fbab
commit 313b9d1a1b
11 changed files with 114 additions and 76 deletions
+2 -2
View File
@@ -876,7 +876,7 @@ void load_effect(QXmlStreamReader& stream, Clip* c) {
int transition_index = create_transition(c, NULL, meta);
Transition* t = c->sequence->transitions.at(transition_index);
if (effect_length > -1) t->length = effect_length;
if (effect_length > -1) t->set_length(effect_length);
t->set_enabled(effect_enabled);
t->load(stream);
@@ -1255,7 +1255,7 @@ bool Project::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
if (td.ctc != NULL) td.ctc->closing_transition = -1;
} else {
int transition_index = create_transition(primary, secondary, meta);
primary->sequence->transitions.at(transition_index)->length = td.length;
primary->sequence->transitions.at(transition_index)->set_length(td.length);
if (td.otc != NULL) td.otc->opening_transition = transition_index;
if (td.ctc != NULL) td.ctc->closing_transition = transition_index;
}
+12 -12
View File
@@ -643,7 +643,7 @@ Clip* Timeline::split_clip(ComboAction* ca, int p, long frame, long post_in) {
pre->get_opening_transition()->secondary_clip->closing_transition = pre->get_opening_transition()->copy(pre->get_opening_transition()->secondary_clip, NULL);
}*/
if (pre->get_opening_transition()->length > new_clip_length) {
if (pre->get_opening_transition()->get_true_length() > new_clip_length) {
ca->append(new ModifyTransitionCommand(pre, TA_OPENING_TRANSITION, new_clip_length));
}
@@ -651,7 +651,7 @@ Clip* Timeline::split_clip(ComboAction* ca, int p, long frame, long post_in) {
}
if (pre->get_closing_transition() != NULL) {
ca->append(new DeleteTransitionCommand(pre, TA_CLOSING_TRANSITION));
if (pre->get_closing_transition()->secondary_clip == NULL) post->get_closing_transition()->length = qMin((long) post->get_closing_transition()->length, post->getLength());
if (pre->get_closing_transition()->secondary_clip == NULL) post->get_closing_transition()->set_length(qMin((long) post->get_closing_transition()->get_true_length(), post->getLength()));
}
return post;
@@ -751,14 +751,14 @@ void Timeline::clean_up_selections(QVector<Selection>& areas) {
bool selection_contains_transition(const Selection& s, Clip* c, int type) {
if (type == TA_OPENING_TRANSITION) {
return c->get_opening_transition() != NULL
&& s.out == c->timeline_in + c->get_opening_transition()->length
&& s.out == c->timeline_in + c->get_opening_transition()->get_true_length()
&& ((c->get_opening_transition()->secondary_clip == NULL && s.in == c->timeline_in)
|| (c->get_opening_transition()->secondary_clip != NULL && s.in == c->timeline_in - c->get_opening_transition()->length));
|| (c->get_opening_transition()->secondary_clip != NULL && s.in == c->timeline_in - c->get_opening_transition()->get_true_length()));
} else {
return c->get_closing_transition() != NULL
&& s.in == c->timeline_out - c->get_closing_transition()->length
&& s.in == c->timeline_out - c->get_closing_transition()->get_true_length()
&& ((c->get_closing_transition()->secondary_clip == NULL && s.out == c->timeline_out)
|| (c->get_closing_transition()->secondary_clip != NULL && s.out == c->timeline_out + c->get_closing_transition()->length));
|| (c->get_closing_transition()->secondary_clip != NULL && s.out == c->timeline_out + c->get_closing_transition()->get_true_length()));
}
}
@@ -795,10 +795,10 @@ void Timeline::delete_areas_and_relink(ComboAction* ca, QVector<Selection>& area
move_clip(ca, c, c->timeline_in, s.in, c->clip_in, c->track);
if (c->get_closing_transition() != NULL) {
if (s.in < c->timeline_out - c->get_closing_transition()->length) {
if (s.in < c->timeline_out - c->get_closing_transition()->get_true_length()) {
ca->append(new DeleteTransitionCommand(c, TA_CLOSING_TRANSITION));
} else {
ca->append(new ModifyTransitionCommand(c, TA_CLOSING_TRANSITION, c->get_closing_transition()->length - (c->timeline_out - s.in)));
ca->append(new ModifyTransitionCommand(c, TA_CLOSING_TRANSITION, c->get_closing_transition()->get_true_length() - (c->timeline_out - s.in)));
}
}
} else if (c->timeline_in < s.out && c->timeline_out > s.out) {
@@ -806,10 +806,10 @@ void Timeline::delete_areas_and_relink(ComboAction* ca, QVector<Selection>& area
move_clip(ca, c, s.out, c->timeline_out, c->clip_in + (s.out - c->timeline_in), c->track);
if (c->get_opening_transition() != NULL) {
if (s.out > c->timeline_in + c->get_opening_transition()->length) {
if (s.out > c->timeline_in + c->get_opening_transition()->get_true_length()) {
ca->append(new DeleteTransitionCommand(c, TA_OPENING_TRANSITION));
} else {
ca->append(new ModifyTransitionCommand(c, TA_OPENING_TRANSITION, c->get_opening_transition()->length - (s.out - c->timeline_in)));
ca->append(new ModifyTransitionCommand(c, TA_OPENING_TRANSITION, c->get_opening_transition()->get_true_length() - (s.out - c->timeline_in)));
}
}
}
@@ -1241,10 +1241,10 @@ bool Timeline::snap_to_timeline(long* l, bool use_playhead, bool use_markers, bo
} else if (snap_to_point(c->timeline_out, l)) {
return true;
} else if (c->get_opening_transition() != NULL
&& snap_to_point(c->timeline_in + c->get_opening_transition()->length, l)) {
&& snap_to_point(c->timeline_in + c->get_opening_transition()->get_true_length(), l)) {
return true;
} else if (c->get_closing_transition() != NULL
&& snap_to_point(c->timeline_out - c->get_closing_transition()->length, l)) {
&& snap_to_point(c->timeline_out - c->get_closing_transition()->get_true_length(), l)) {
return true;
}
}
+3 -3
View File
@@ -181,7 +181,7 @@ Clip::~Clip() {
long Clip::get_clip_in_with_transition() {
if (get_opening_transition() != NULL && get_opening_transition()->secondary_clip != NULL) {
// we must be the secondary clip, so return (timeline in - length)
return clip_in - get_opening_transition()->length;
return clip_in - get_opening_transition()->get_true_length();
}
return clip_in;
}
@@ -189,7 +189,7 @@ long Clip::get_clip_in_with_transition() {
long Clip::get_timeline_in_with_transition() {
if (get_opening_transition() != NULL && get_opening_transition()->secondary_clip != NULL) {
// we must be the secondary clip, so return (timeline in - length)
return timeline_in - get_opening_transition()->length;
return timeline_in - get_opening_transition()->get_true_length();
}
return timeline_in;
}
@@ -197,7 +197,7 @@ long Clip::get_timeline_in_with_transition() {
long Clip::get_timeline_out_with_transition() {
if (get_closing_transition() != NULL && get_closing_transition()->secondary_clip != NULL) {
// we must be the primary clip, so return (timeline out + length2)
return timeline_out + get_closing_transition()->length;
return timeline_out + get_closing_transition()->get_true_length();
} else {
return timeline_out;
}
+24 -24
View File
@@ -220,7 +220,6 @@ void EffectInit::run() {
Effect::Effect(Clip* c, const EffectMeta *em) :
parent_clip(c),
meta(em),
length(30),
enable_shader(false),
enable_coords(false),
enable_superimpose(false),
@@ -446,8 +445,8 @@ void Effect::copy_field_keyframes(Effect* e) {
}
}
EffectRow* Effect::add_row(const QString& name) {
EffectRow* row = new EffectRow(this, ui_layout, name, rows.size());
EffectRow* Effect::add_row(const QString& name, bool savable) {
EffectRow* row = new EffectRow(this, savable, ui_layout, name, rows.size());
rows.append(row);
return row;
}
@@ -668,31 +667,32 @@ void Effect::load(QXmlStreamReader& stream) {
void Effect::save(QXmlStreamWriter& stream) {
stream.writeAttribute("name", meta->name);
stream.writeAttribute("enabled", QString::number(is_enabled()));
stream.writeAttribute("length", QString::number(length));
for (int i=0;i<rows.size();i++) {
EffectRow* row = rows.at(i);
stream.writeStartElement("row"); // row
stream.writeStartElement("keyframes"); // keyframes
stream.writeAttribute("enabled", QString::number(row->isKeyframing()));
for (int j=0;j<row->keyframe_times.size();j++) {
stream.writeStartElement("key"); // key
stream.writeAttribute("frame", QString::number(row->keyframe_times.at(j)));
stream.writeAttribute("type", QString::number(row->keyframe_types.at(j)));
stream.writeEndElement(); // key
if (row->savable) {
stream.writeStartElement("row"); // row
stream.writeStartElement("keyframes"); // keyframes
stream.writeAttribute("enabled", QString::number(row->isKeyframing()));
for (int j=0;j<row->keyframe_times.size();j++) {
stream.writeStartElement("key"); // key
stream.writeAttribute("frame", QString::number(row->keyframe_times.at(j)));
stream.writeAttribute("type", QString::number(row->keyframe_types.at(j)));
stream.writeEndElement(); // key
}
stream.writeEndElement(); // keyframes
for (int j=0;j<row->fieldCount();j++) {
EffectField* field = row->field(j);
stream.writeStartElement("field"); // field
stream.writeAttribute("id", field->id);
stream.writeAttribute("value", save_data_to_string(field->type, field->get_current_data()));
for (int k=0;k<field->keyframe_data.size();k++) {
stream.writeTextElement("key", save_data_to_string(field->type, field->keyframe_data.at(k)));
}
stream.writeEndElement(); // field
}
stream.writeEndElement(); // row
}
stream.writeEndElement(); // keyframes
for (int j=0;j<row->fieldCount();j++) {
EffectField* field = row->field(j);
stream.writeStartElement("field"); // field
stream.writeAttribute("id", field->id);
stream.writeAttribute("value", save_data_to_string(field->type, field->get_current_data()));
for (int k=0;k<field->keyframe_data.size();k++) {
stream.writeTextElement("key", save_data_to_string(field->type, field->keyframe_data.at(k)));
}
stream.writeEndElement(); // field
}
stream.writeEndElement(); // row
}
}
+1 -2
View File
@@ -113,12 +113,11 @@ public:
~Effect();
Clip* parent_clip;
const EffectMeta* meta;
long length; // used only for transitions
int id;
QString name;
CollapsibleWidget* container;
EffectRow* add_row(const QString &name);
EffectRow* add_row(const QString &name, bool savable = true);
EffectRow* row(int i);
int row_count();
+2 -1
View File
@@ -14,8 +14,9 @@
#include "effect.h"
#include "ui/viewerwidget.h"
EffectRow::EffectRow(Effect *parent, QGridLayout *uilayout, const QString &n, int row) :
EffectRow::EffectRow(Effect *parent, bool save, QGridLayout *uilayout, const QString &n, int row) :
parent_effect(parent),
savable(save),
keyframing(false),
ui(uilayout),
name(n),
+2 -1
View File
@@ -14,7 +14,7 @@ class QPushButton;
class EffectRow : public QObject {
Q_OBJECT
public:
EffectRow(Effect* parent, QGridLayout* uilayout, const QString& n, int row);
EffectRow(Effect* parent, bool save, QGridLayout* uilayout, const QString& n, int row);
~EffectRow();
EffectField* add_field(int type, const QString &id, int colspan = 1);
EffectField* field(int i);
@@ -24,6 +24,7 @@ public:
void delete_keyframe_at_time(KeyframeDelete* kd, long time);
QLabel* label;
Effect* parent_effect;
bool savable;
bool isKeyframing();
void setKeyframing(bool);
+31 -2
View File
@@ -11,10 +11,25 @@
#include "effects/internal/logarithmicfadetransition.h"
#include "effects/internal/cubetransition.h"
#include "ui/labelslider.h"
#include "panels/panels.h"
#include "panels/timeline.h"
#include <QMessageBox>
Transition::Transition(Clip* c, Clip* s, const EffectMeta* em) : Effect(c, em), secondary_clip(s) {
// add_row("Length:", false)->add_field(EFFECT_FIELD_DOUBLE, "length");
Transition::Transition(Clip* c, Clip* s, const EffectMeta* em) :
Effect(c, em), secondary_clip(s),
length(30)
{
length_field = add_row("Length:", false)->add_field(EFFECT_FIELD_DOUBLE, "length");
connect(length_field, SIGNAL(changed()), this, SLOT(set_length_from_slider()));
length_field->set_double_default_value(30);
length_field->set_double_minimum_value(0);
LabelSlider* length_ui_ele = static_cast<LabelSlider*>(length_field->ui_element);
length_ui_ele->set_display_type(LABELSLIDER_FRAMENUMBER);
length_ui_ele->set_frame_rate(parent_clip->sequence->frame_rate);
}
int Transition::copy(Clip *c, Clip* s) {
@@ -23,6 +38,15 @@ int Transition::copy(Clip *c, Clip* s) {
return copy_index;
}
void Transition::set_length(long l) {
length = l;
length_field->set_double_value(l);
}
long Transition::get_true_length() {
return length;
}
long Transition::get_length() {
if (secondary_clip != NULL) {
return length * 2;
@@ -30,6 +54,11 @@ long Transition::get_length() {
return length;
}
void Transition::set_length_from_slider() {
set_length(length_field->get_double_value(0));
update_ui(false);
}
Transition* get_transition_from_meta(Clip* c, Clip* s, const EffectMeta* em) {
if (!em->filename.isEmpty()) {
// load effect from file
+8
View File
@@ -17,11 +17,19 @@
int create_transition(Clip* c, Clip* s, const EffectMeta* em);
class Transition : public Effect {
Q_OBJECT
public:
Transition(Clip* c, Clip* s, const EffectMeta* em);
int copy(Clip* c, Clip* s);
Clip* secondary_clip;
void set_length(long l);
long get_true_length();
long get_length();
private slots:
void set_length_from_slider();
private:
long length; // used only for transitions
EffectField* length_field;
};
#endif // TRANSITION_H
+5 -5
View File
@@ -258,7 +258,7 @@ void AddTransitionCommand::redo() {
secondary->closing_transition = clip->opening_transition;
}
if (length > 0) {
clip->get_opening_transition()->length = length;
clip->get_opening_transition()->set_length(length);
}
} else {
old_ptransition = clip->closing_transition;
@@ -268,7 +268,7 @@ void AddTransitionCommand::redo() {
secondary->opening_transition = clip->closing_transition;
}
if (length > 0) {
clip->get_closing_transition()->length = length;
clip->get_closing_transition()->set_length(length);
}
}
mainWindow->setWindowModified(true);
@@ -283,14 +283,14 @@ ModifyTransitionCommand::ModifyTransitionCommand(Clip* c, int itype, long ilengt
void ModifyTransitionCommand::undo() {
Transition* t = (type == TA_OPENING_TRANSITION) ? clip->get_opening_transition() : clip->get_closing_transition();
t->length = old_length;
t->set_length(old_length);
mainWindow->setWindowModified(old_project_changed);
}
void ModifyTransitionCommand::redo() {
Transition* t = (type == TA_OPENING_TRANSITION) ? clip->get_opening_transition() : clip->get_closing_transition();
old_length = t->length;
t->length = new_length;
old_length = t->get_true_length();
t->set_length(new_length);
mainWindow->setWindowModified(true);
}
+24 -24
View File
@@ -607,12 +607,12 @@ void TimelineWidget::mousePressEvent(QMouseEvent *event) {
if (panel_timeline->transition_select == TA_OPENING_TRANSITION && clip->get_opening_transition() != NULL) {
s.in = clip->timeline_in;
if (clip->get_opening_transition()->secondary_clip != NULL) s.in -= clip->get_opening_transition()->length;
s.out = clip->timeline_in + clip->get_opening_transition()->length;
if (clip->get_opening_transition()->secondary_clip != NULL) s.in -= clip->get_opening_transition()->get_true_length();
s.out = clip->timeline_in + clip->get_opening_transition()->get_true_length();
} else if (panel_timeline->transition_select == TA_CLOSING_TRANSITION && clip->get_closing_transition() != NULL) {
s.in = clip->timeline_out - clip->get_closing_transition()->length;
s.in = clip->timeline_out - clip->get_closing_transition()->get_true_length();
s.out = clip->timeline_out;
if (clip->get_closing_transition()->secondary_clip != NULL) s.out += clip->get_closing_transition()->length;
if (clip->get_closing_transition()->secondary_clip != NULL) s.out += clip->get_closing_transition()->get_true_length();
}
sequence->selections.append(s);
}
@@ -629,13 +629,13 @@ void TimelineWidget::mousePressEvent(QMouseEvent *event) {
if (panel_timeline->tool == TIMELINE_TOOL_POINTER) {
if (panel_timeline->transition_select == TA_OPENING_TRANSITION) {
s.out = clip->timeline_in + clip->get_opening_transition()->length;
if (clip->get_opening_transition()->secondary_clip != NULL) s.in -= clip->get_opening_transition()->length;
s.out = clip->timeline_in + clip->get_opening_transition()->get_true_length();
if (clip->get_opening_transition()->secondary_clip != NULL) s.in -= clip->get_opening_transition()->get_true_length();
}
if (panel_timeline->transition_select == TA_CLOSING_TRANSITION) {
s.in = clip->timeline_out - clip->get_closing_transition()->length;
if (clip->get_closing_transition()->secondary_clip != NULL) s.out += clip->get_closing_transition()->length;
s.in = clip->timeline_out - clip->get_closing_transition()->get_true_length();
if (clip->get_closing_transition()->secondary_clip != NULL) s.out += clip->get_closing_transition()->get_true_length();
}
}
@@ -707,7 +707,7 @@ void make_room_for_transition(ComboAction* ca, Clip* c, int type, long transitio
if (c->get_closing_transition() != NULL) {
if (transition_end >= c->timeline_out) {
ca->append(new DeleteTransitionCommand(c, TA_CLOSING_TRANSITION));
} else if (transition_end > c->timeline_out - c->get_closing_transition()->length) {
} else if (transition_end > c->timeline_out - c->get_closing_transition()->get_true_length()) {
ca->append(new ModifyTransitionCommand(c, TA_CLOSING_TRANSITION, c->timeline_out - transition_end));
}
}
@@ -718,7 +718,7 @@ void make_room_for_transition(ComboAction* ca, Clip* c, int type, long transitio
if (c->get_opening_transition() != NULL) {
if (transition_start <= c->timeline_in) {
ca->append(new DeleteTransitionCommand(c, TA_OPENING_TRANSITION));
} else if (transition_start < c->timeline_in + c->get_opening_transition()->length) {
} else if (transition_start < c->timeline_in + c->get_opening_transition()->get_true_length()) {
ca->append(new ModifyTransitionCommand(c, TA_OPENING_TRANSITION, transition_start - c->timeline_in));
}
}
@@ -941,22 +941,22 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
if (c->get_opening_transition() != NULL) {
long max_open_length = new_clip_length;
if (c->get_closing_transition() != NULL && !panel_timeline->trim_in_point) {
max_open_length -= c->get_closing_transition()->length;
max_open_length -= c->get_closing_transition()->get_true_length();
}
if (max_open_length <= 0) {
ca->append(new DeleteTransitionCommand(c, TA_OPENING_TRANSITION));
} else if (c->get_opening_transition()->length > max_open_length) {
} else if (c->get_opening_transition()->get_true_length() > max_open_length) {
ca->append(new ModifyTransitionCommand(c, TA_OPENING_TRANSITION, max_open_length));
}
}
if (c->get_closing_transition() != NULL) {
long max_open_length = new_clip_length;
if (c->get_opening_transition() != NULL && panel_timeline->trim_in_point) {
max_open_length -= c->get_opening_transition()->length;
max_open_length -= c->get_opening_transition()->get_true_length();
}
if (max_open_length <= 0) {
ca->append(new DeleteTransitionCommand(c, TA_CLOSING_TRANSITION));
} else if (c->get_closing_transition()->length > max_open_length) {
} else if (c->get_closing_transition()->get_true_length() > max_open_length) {
ca->append(new ModifyTransitionCommand(c, TA_CLOSING_TRANSITION, max_open_length));
}
}
@@ -1144,7 +1144,7 @@ void TimelineWidget::init_ghosts() {
g.out = g.old_out = c->get_timeline_out_with_transition();
g.ghost_length = c->get_closing_transition()->get_length();
g.in = g.old_in = g.out - g.ghost_length;
g.clip_in = g.old_clip_in = c->clip_in + c->getLength() - c->get_closing_transition()->length;
g.clip_in = g.old_clip_in = c->clip_in + c->getLength() - c->get_closing_transition()->get_true_length();
}
// used for trim ops
@@ -1291,7 +1291,7 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) {
Clip* otc = g.transition->parent_clip;
Clip* ctc = g.transition->secondary_clip;
validate_transitions(otc, ctc, g.transition->length, frame_diff);
validate_transitions(otc, ctc, g.transition->get_true_length(), frame_diff);
// TESTING CODE END
if (g.trim_in) {
@@ -1340,7 +1340,7 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) {
validator = g.transition->secondary_clip->get_timeline_out_with_transition() - g.transition->secondary_clip->get_timeline_in_with_transition() - g.transition->get_length() + g.transition->secondary_clip->get_clip_in_with_transition() + frame_diff;
if (validator < 0) frame_diff -= validator;
validator = g.transition->parent_clip->clip_in + frame_diff - g.transition->parent_clip->getMaximumLength() + g.transition->length;
validator = g.transition->parent_clip->clip_in + frame_diff - g.transition->parent_clip->getMaximumLength() + g.transition->get_true_length();
if (validator > 0) frame_diff -= validator;
validator = g.transition->secondary_clip->get_timeline_out_with_transition() - g.transition->secondary_clip->get_timeline_in_with_transition() + g.transition->secondary_clip->get_clip_in_with_transition() + frame_diff - g.transition->secondary_clip->getMaximumLength();
@@ -1935,9 +1935,9 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
tooltip_timer.start();
tooltip_clip = i;
if (c->get_opening_transition() != NULL && panel_timeline->cursor_frame <= c->timeline_in + c->get_opening_transition()->length) {
if (c->get_opening_transition() != NULL && panel_timeline->cursor_frame <= c->timeline_in + c->get_opening_transition()->get_true_length()) {
panel_timeline->transition_select = TA_OPENING_TRANSITION;
} else if (c->get_closing_transition() != NULL && panel_timeline->cursor_frame >= c->timeline_out - c->get_closing_transition()->length) {
} else if (c->get_closing_transition() != NULL && panel_timeline->cursor_frame >= c->timeline_out - c->get_closing_transition()->get_true_length()) {
panel_timeline->transition_select = TA_CLOSING_TRANSITION;
}
}
@@ -1961,7 +1961,7 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
}
if (panel_timeline->tool == TIMELINE_TOOL_POINTER) {
if (c->get_opening_transition() != NULL) {
long transition_point = c->timeline_in + c->get_opening_transition()->length;
long transition_point = c->timeline_in + c->get_opening_transition()->get_true_length();
if (transition_point > mouse_frame_lower && transition_point < mouse_frame_upper) {
int nc = qAbs(transition_point - 1 - panel_timeline->cursor_frame);
@@ -1975,7 +1975,7 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
}
}
if (c->get_closing_transition() != NULL) {
long transition_point = c->timeline_out - c->get_closing_transition()->length;
long transition_point = c->timeline_out - c->get_closing_transition()->get_true_length();
if (transition_point > mouse_frame_lower && transition_point < mouse_frame_upper) {
int nc = qAbs(transition_point + 1 - panel_timeline->cursor_frame);
if (nc < closeness) {
@@ -2129,7 +2129,7 @@ void draw_transition(QPainter& p, Clip* c, const QRect& clip_rect, QRect& text_r
Transition* t = (transition_type == TA_OPENING_TRANSITION) ? c->get_opening_transition() : c->get_closing_transition();
if (t != NULL) {
QColor transition_color(255, 0, 0, 16);
int transition_width = getScreenPointFromFrame(panel_timeline->zoom, t->length);
int transition_width = getScreenPointFromFrame(panel_timeline->zoom, t->get_true_length());
int transition_height = clip_rect.height();
int tr_y = clip_rect.y();
int tr_x = 0;
@@ -2274,12 +2274,12 @@ void TimelineWidget::paintEvent(QPaintEvent*) {
if (thumb_x < width() && thumb_y < height()) {
int space_for_thumb = clip_rect.width()-1;
if (clip->get_opening_transition() != NULL) {
int ot_width = getScreenPointFromFrame(panel_timeline->zoom, clip->get_opening_transition()->length);
int ot_width = getScreenPointFromFrame(panel_timeline->zoom, clip->get_opening_transition()->get_true_length());
thumb_x += ot_width;
space_for_thumb -= ot_width;
}
if (clip->get_closing_transition() != NULL) {
space_for_thumb -= getScreenPointFromFrame(panel_timeline->zoom, clip->get_closing_transition()->length);
space_for_thumb -= getScreenPointFromFrame(panel_timeline->zoom, clip->get_closing_transition()->get_true_length());
}
int thumb_height = clip_rect.height()-thumb_y;
int thumb_width = (thumb_height*((double)ms->video_preview.width()/(double)ms->video_preview.height()));