From 0a5c3fe36e5fe8235b98658e37ded2da13b0ada8 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Tue, 19 Mar 2019 22:23:08 +1100 Subject: [PATCH] fixed gizmos --- effects/effect.cpp | 4 +++- rendering/renderfunctions.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/effects/effect.cpp b/effects/effect.cpp index 6cdd7bf4d..fc3748328 100644 --- a/effects/effect.cpp +++ b/effects/effect.cpp @@ -989,6 +989,8 @@ void Effect::gizmo_world_to_screen(const QMatrix4x4& matrix, const QMatrix4x4& p for (int j=0;jget_point_count();j++) { + // Convert the world point from the gizmo into a screen point relative to the sequence's dimensions + QVector3D screen_pos = g->world_pos.at(j).project(matrix, projection, QRect(0, @@ -996,7 +998,7 @@ void Effect::gizmo_world_to_screen(const QMatrix4x4& matrix, const QMatrix4x4& p parent_clip->sequence->width, parent_clip->sequence->height)); - g->screen_pos[j] = QPoint(screen_pos.x(), screen_pos.y()); + g->screen_pos[j] = QPoint(screen_pos.x(), parent_clip->sequence->height-screen_pos.y()); } } diff --git a/rendering/renderfunctions.cpp b/rendering/renderfunctions.cpp index e617a42b9..c2515e4a2 100644 --- a/rendering/renderfunctions.cpp +++ b/rendering/renderfunctions.cpp @@ -615,7 +615,7 @@ GLuint compose_sequence(ComposeSequenceParams ¶ms) { params.gizmos->gizmo_draw(timecode, coords); // convert gizmo coords to screen coords - params.gizmos->gizmo_world_to_screen(projection, coords.matrix); + params.gizmos->gizmo_world_to_screen(coords.matrix, projection); }