Skip to content

Commit

Permalink
Fix crash when importing and the scrubber is not on a keyframe
Browse files Browse the repository at this point in the history
  • Loading branch information
MrStevns committed Sep 23, 2024
1 parent 7569492 commit 9e83f75
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/src/importpositiondialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ GNU General Public License for more details.
#include "viewmanager.h"
#include "layermanager.h"
#include "scribblearea.h"
#include "camera.h"

ImportPositionDialog::ImportPositionDialog(Editor* editor, QWidget *parent) :
QDialog(parent),
Expand Down Expand Up @@ -76,7 +77,7 @@ void ImportPositionDialog::changeImportView()
Q_ASSERT(layerCam);

if (mImportOption == ImportPosition::Type::CenterOfCamera) {
KeyFrame* camKey = layerCam->getKeyFrameAt(mEditor->currentFrame());
KeyFrame* camKey = layerCam->getLastCameraAtFrame(mEditor->currentFrame(), 0);
transform = layerCam->getViewAtFrame(camKey->pos()).inverted();
} else {
transform = layerCam->getViewAtFrame(mEditor->currentFrame()).inverted();
Expand Down

0 comments on commit 9e83f75

Please sign in to comment.