OpenToonz - An open-source full-featured 2D animation creation software
C
Fix Flipbook Crash (#1224)
Jeremy Bullock73a1500ce7b1
diff --git a/toonz/sources/toonz/imageviewer.cpp b/toonz/sources/toonz/imageviewer.cppindex 4abfd878c..7d1aad080 100644--- a/toonz/sources/toonz/imageviewer.cpp+++ b/toonz/sources/toonz/imageviewer.cpp@@ -730,6 +730,7 @@ void ImageViewer::updateCursor(const TPoint &curPos) {/*! If middle button is pressed pan the image. Update current mouse position.*/void ImageViewer::mouseMoveEvent(QMouseEvent *event) {+ if (!m_image) return;QPoint curQPos = event->pos() * getDevPixRatio();TPoint curPos = TPoint(curQPos.x(), curQPos.y());@@ -947,6 +948,7 @@ int ImageViewer::getDragType(const TPoint &pos, const TRect &loadbox) {//-------------------------------------------------------------------------------void ImageViewer::mouseDoubleClickEvent(QMouseEvent *event) {+ if (!m_image) return;if (m_visualSettings.m_defineLoadbox && m_flipbook) {m_flipbook->setLoadbox(TRect());update();@@ -957,6 +959,7 @@ void ImageViewer::mouseDoubleClickEvent(QMouseEvent *event) {//------------------------------------------------------------------------------void ImageViewer::mousePressEvent(QMouseEvent *event) {+ if (!m_image) return;m_pos = event->pos() * getDevPixRatio();m_pressedMousePos = TPoint(m_pos.x(), m_pos.y());m_mouseButton = event->button();@@ -1004,6 +1007,7 @@ void ImageViewer::mousePressEvent(QMouseEvent *event) {/*! Reset current mouse position and current mouse button event.*/void ImageViewer::mouseReleaseEvent(QMouseEvent *event) {+ if (!m_image) return;if (m_draggingZoomSelection && !m_visualSettings.m_defineLoadbox) {m_draggingZoomSelection = false;@@ -1039,6 +1043,7 @@ void ImageViewer::mouseReleaseEvent(QMouseEvent *event) {/*! Apply zoom.*/void ImageViewer::wheelEvent(QWheelEvent *event) {+ if (!m_image) return;if (event->orientation() == Qt::Horizontal) return;int delta = event->delta() > 0 ? 120 : -120;QPoint center(event->pos().x() * getDevPixRatio() - width() / 2,