Skip to content

Commit

Permalink
gui: remove unneeded if nest
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Koucher <arthurckoucher@gmail.com>
  • Loading branch information
AcKoucher committed Nov 16, 2023
1 parent b9d065d commit 392c008
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/gui/src/layoutViewer.cpp
Original file line number Diff line number Diff line change
@@ -2378,15 +2378,13 @@ bool LayoutScroll::eventFilter(QObject* object, QEvent* event)
if (event->type() == QEvent::MouseButtonRelease) {
QMouseEvent* release_event = static_cast<QMouseEvent*>(event);

if (release_event->button() == Qt::LeftButton) {
if (scrolling_with_cursor_) {
scrolling_with_cursor_ = false;

// handle the case in which a user might click on one of the
// scrollbars, hold the button and move the cursor away
if (viewer_->isCursorInsideViewport()) {
viewer_->updateCursorCoordinates();
}
if (release_event->button() == Qt::LeftButton && scrolling_with_cursor_) {
scrolling_with_cursor_ = false;

// handle the case in which a user might click on one of the
// scrollbars, hold the button and move the cursor away
if (viewer_->isCursorInsideViewport()) {
viewer_->updateCursorCoordinates();
}
}
}

0 comments on commit 392c008

Please sign in to comment.