added rudimentary shake effect
This commit is contained in:
+4
-3
@@ -329,8 +329,8 @@ void Timeline::delete_selection(bool ripple_delete) {
|
||||
}
|
||||
}
|
||||
|
||||
int lerp(int a, int b, float t) {
|
||||
return ((1.0f - t) * a) + (t * b);
|
||||
int lerp(int a, int b, double t) {
|
||||
return ((1.0 - t) * a) + (t * b);
|
||||
}
|
||||
|
||||
void Timeline::set_zoom(bool in) {
|
||||
@@ -343,7 +343,7 @@ void Timeline::set_zoom(bool in) {
|
||||
lerp(
|
||||
ui->timeline_area->horizontalScrollBar()->value(),
|
||||
getScreenPointFromFrame(playhead) - (ui->timeline_area->width()/2),
|
||||
0.99f
|
||||
0.99
|
||||
)
|
||||
);
|
||||
redraw_all_clips(false);
|
||||
@@ -653,6 +653,7 @@ void Timeline::paste() {
|
||||
|
||||
// create copy of clip and offset by playhead
|
||||
Clip* cc = c->copy();
|
||||
cc->sequence = sequence;
|
||||
cc->timeline_in += playhead;
|
||||
cc->timeline_out += playhead;
|
||||
cc->track = c->track;
|
||||
|
||||
@@ -16,6 +16,8 @@ struct Clip;
|
||||
struct Media;
|
||||
struct MediaStream;
|
||||
|
||||
int lerp(int a, int b, double t);
|
||||
|
||||
struct Ghost {
|
||||
int clip;
|
||||
long in;
|
||||
|
||||
+7
-1
@@ -346,7 +346,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QScrollArea" name="timeline_area">
|
||||
<widget class="ScrollArea" name="timeline_area">
|
||||
<property name="verticalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOn</enum>
|
||||
</property>
|
||||
@@ -459,6 +459,12 @@
|
||||
<header>ui/audiomonitor.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ScrollArea</class>
|
||||
<extends>QScrollArea</extends>
|
||||
<header>ui/scrollarea.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../icons/icons.qrc"/>
|
||||
|
||||
Reference in New Issue
Block a user