Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/app/GUI/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,15 @@ void MainWindow::setupDocument()
if (mTimeline) { mTimeline->stopPreview(); }
});

#ifdef Q_OS_MAC
// https://github.com/friction2d/friction/pull/736
connect(&mDocument, &Document::fitCanvasToSize, this, []() {
const auto target = KeyFocusTarget::KFT_getCurrentTarget();
const auto cwTarget = dynamic_cast<CanvasWindow*>(target);
if (cwTarget) { cwTarget->fitCanvasToSize(); }
});
#endif

// set defaults
mDocument.setPath("");
mDocument.fDrawPathManual = false;
Expand Down
3 changes: 3 additions & 0 deletions src/core/Private/document.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ class CORE_EXPORT Document : public SingleWidgetTarget {
void openApplyExpressionDialog(QrealAnimator* const target);
void newVideo(const VideoBox::VideoSpecs specs);
void currentPixelColor(const QColor &color);

// https://github.com/friction2d/friction/pull/736
void fitCanvasToSize();
};

#endif // DOCUMENT_H
4 changes: 4 additions & 0 deletions src/ui/dialogs/scenesettingsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,10 @@ void SceneSettingsDialog::sNewSceneDialog(Document& document,
newCanvas->anim_setAbsFrame(newCanvas->getFrameRange().fMin);
dialog->close();
docPtr->actionFinished();
#ifdef Q_OS_MAC
// https://github.com/friction2d/friction/pull/736
emit docPtr->fitCanvasToSize();
#endif
});

dialog->show();
Expand Down
Loading