mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-19 03:16:10 +00:00
Proper fix for the infinite loop that had occurred to the Overview (#1156)
This commit is contained in:
parent
1ee1d7d948
commit
85a57f9e17
@ -74,11 +74,19 @@ void OverviewView::paintEvent(QPaintEvent *event)
|
||||
p.drawRect(rangeRect);
|
||||
}
|
||||
|
||||
void OverviewView::mousePressEvent(QMouseEvent *event)
|
||||
bool OverviewView::mouseContainsRect(QMouseEvent *event)
|
||||
{
|
||||
if (rangeRect.contains(event->pos())) {
|
||||
mouseActive = true;
|
||||
initialDiff = QPointF(event->localPos().x() - rangeRect.x(), event->localPos().y() - rangeRect.y());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void OverviewView::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
if (mouseContainsRect(event)) {
|
||||
return;
|
||||
}
|
||||
qreal w = rangeRect.width();
|
||||
@ -88,7 +96,7 @@ void OverviewView::mousePressEvent(QMouseEvent *event)
|
||||
rangeRect = QRectF(x, y, w, h);
|
||||
viewport()->update();
|
||||
emit mouseMoved();
|
||||
GraphView::mousePressEvent(event);
|
||||
mouseContainsRect(event);
|
||||
}
|
||||
|
||||
void OverviewView::mouseReleaseEvent(QMouseEvent *event)
|
||||
|
@ -98,6 +98,11 @@ private:
|
||||
*/
|
||||
void adjustScale();
|
||||
|
||||
/**
|
||||
* @brief if the mouse is in the rect in Overview.
|
||||
*/
|
||||
bool mouseContainsRect(QMouseEvent *event);
|
||||
|
||||
/**
|
||||
* @brief base background color changing depending on the theme
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user