fixed auto-scale breaking positioning
This commit is contained in:
@@ -400,14 +400,6 @@ GLuint compose_sequence(ComposeSequenceParams ¶ms) {
|
||||
coords.blendmode = -1;
|
||||
coords.opacity = 1.0;
|
||||
|
||||
// if auto-scale is enabled, auto-scale the clip
|
||||
if (c->autoscaled() && (video_width != s->width && video_height != s->height)) {
|
||||
float width_multiplier = float(s->width) / float(video_width);
|
||||
float height_multiplier = float(s->height) / float(video_height);
|
||||
float scale_multiplier = qMin(width_multiplier, height_multiplier);
|
||||
glScalef(scale_multiplier, scale_multiplier, 1);
|
||||
}
|
||||
|
||||
// == EFFECT CODE START ==
|
||||
|
||||
// get current sequence time in seconds (used for effects)
|
||||
@@ -418,10 +410,7 @@ GLuint compose_sequence(ComposeSequenceParams ¶ms) {
|
||||
Effect* e = c->effects.at(j).get();
|
||||
process_effect(c, e, timecode, coords, textureID, fbo_switcher, params.texture_failed, kTransitionNone);
|
||||
|
||||
if (e == params.gizmos) {
|
||||
e->gizmo_draw(timecode, coords); // set correct gizmo coords
|
||||
e->gizmo_world_to_screen(); // convert gizmo coords to screen coords
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// if the clip has an opening transition, process that now
|
||||
@@ -442,6 +431,25 @@ GLuint compose_sequence(ComposeSequenceParams ¶ms) {
|
||||
|
||||
// == EFFECT CODE END ==
|
||||
|
||||
|
||||
// Check whether the parent clip is auto-scaledc
|
||||
if (c->autoscaled()
|
||||
&& (video_width != s->width
|
||||
&& video_height != s->height)) {
|
||||
float width_multiplier = float(s->width) / float(video_width);
|
||||
float height_multiplier = float(s->height) / float(video_height);
|
||||
float scale_multiplier = qMin(width_multiplier, height_multiplier);
|
||||
glScalef(scale_multiplier, scale_multiplier, 1);
|
||||
}
|
||||
|
||||
// Configure effect gizmos if they exist
|
||||
if (params.gizmos != nullptr) {
|
||||
params.gizmos->gizmo_draw(timecode, coords); // set correct gizmo coords
|
||||
params.gizmos->gizmo_world_to_screen(); // convert gizmo coords to screen coords
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (textureID > 0) {
|
||||
// set viewport to sequence size
|
||||
params.ctx->functions()->glViewport(0, 0, s->width, s->height);
|
||||
|
||||
Reference in New Issue
Block a user