This commit is contained in:
itsmattkc
2018-06-09 02:08:04 -07:00
parent b8fc5f4dac
commit 1f8f3b0800
3 changed files with 11 additions and 6 deletions
+3
View File
@@ -41,6 +41,9 @@ public:
QSpinBox* opacity;
public slots:
void toggle_uniform_scale(bool enabled);
private:
int default_anchor_x;
int default_anchor_y;
};
// audio effects
+6 -4
View File
@@ -78,8 +78,10 @@ TransformEffect::TransformEffect(Clip* c) : Effect(c) {
scale_y->setValue(100);
scale_y->setEnabled(false);
uniform_scale_box->setChecked(true);
anchor_x_box->setValue(c->media_stream->video_width/2);
anchor_y_box->setValue(c->media_stream->video_height/2);
default_anchor_x = c->media_stream->video_width/2;
default_anchor_y = c->media_stream->video_height/2;
anchor_x_box->setValue(default_anchor_x);
anchor_y_box->setValue(default_anchor_y);
opacity->setValue(100);
connect(position_x, SIGNAL(valueChanged(int)), this, SLOT(field_changed()));
@@ -117,8 +119,8 @@ void TransformEffect::process_gl(int* anchor_x, int* anchor_y) {
glTranslatef(position_x->value()-(parent_clip->sequence->width/2), position_y->value()-(parent_clip->sequence->height/2), 0);
// anchor point
*anchor_x += anchor_x_box->value();
*anchor_y += anchor_y_box->value();
*anchor_x += (anchor_x_box->value()-default_anchor_x);
*anchor_y += (anchor_y_box->value()-default_anchor_y);
// rotation
glRotatef(rotation->value(), 0, 0, 1);
+2 -2
View File
@@ -86,8 +86,8 @@ void ViewerWidget::paintGL()
int half_width = c->sequence->width/2;
int half_height = c->sequence->height/2;
glOrtho(-half_width, half_width, half_height,- half_height, -1, 1);
int anchor_x = 0;
int anchor_y = 0;
int anchor_x = c->media_stream->video_width/2;
int anchor_y = c->media_stream->video_height/2;
// perform all transform effects
for (int j=0;j<c->effects.size();j++) {