Skip to content

Commit

Permalink
Merge pull request #100 from SCCapstone/scrollCrashFix
Browse files Browse the repository at this point in the history
Trying Mutex Lock to fix scroll crash
  • Loading branch information
Geist-of-the-Automaton authored Apr 26, 2021
2 parents fb18045 + 7a00077 commit 80c09df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Roto/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ void MainWindow::mouseDoubleClickEvent(QMouseEvent *event) {
}

void MainWindow::wheelEvent(QWheelEvent *event) {
scrollLock.lock();
if (ioh->getWorkingLayer() == nullptr)
return;
int dy = event->angleDelta().y();
Expand Down Expand Up @@ -305,6 +306,7 @@ void MainWindow::wheelEvent(QWheelEvent *event) {
}
else if (mode == Raster_Mode)
ioh->getWorkingLayer()->spinWheel(dy);
scrollLock.unlock();
refresh();
}

Expand Down
2 changes: 2 additions & 0 deletions Roto/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const QString Kernal_Loc = "/Kernals/";
const QString FetchLink = "https://github.com/SCCapstone/SnakyBusiness/raw/master";
const vector <string> acceptedImportImageFormats = {"bmp", "jpg", "jpeg", "png", "ppm", "xbm", "xpm", "gif", "pbm", "pgm"};
const vector <string> acceptedExportImageFormats = {"bmp", "jpg", "jpeg", "png", "ppm", "xbm", "xpm"};
static mutex scrollLock;

enum downloadAction {DownloadThenRestart, DownLoadThenOpen};

Expand Down Expand Up @@ -177,6 +178,7 @@ public slots:
QProgressDialog *progress;
brushShape *brushProlfiler;
patternProfiler *pp;
bool lock;
QLabel *histograms;
};

Expand Down

0 comments on commit 80c09df

Please sign in to comment.