mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-20 03:46:11 +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);
|
p.drawRect(rangeRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverviewView::mousePressEvent(QMouseEvent *event)
|
bool OverviewView::mouseContainsRect(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (rangeRect.contains(event->pos())) {
|
if (rangeRect.contains(event->pos())) {
|
||||||
mouseActive = true;
|
mouseActive = true;
|
||||||
initialDiff = QPointF(event->localPos().x() - rangeRect.x(), event->localPos().y() - rangeRect.y());
|
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;
|
return;
|
||||||
}
|
}
|
||||||
qreal w = rangeRect.width();
|
qreal w = rangeRect.width();
|
||||||
@ -88,7 +96,7 @@ void OverviewView::mousePressEvent(QMouseEvent *event)
|
|||||||
rangeRect = QRectF(x, y, w, h);
|
rangeRect = QRectF(x, y, w, h);
|
||||||
viewport()->update();
|
viewport()->update();
|
||||||
emit mouseMoved();
|
emit mouseMoved();
|
||||||
GraphView::mousePressEvent(event);
|
mouseContainsRect(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverviewView::mouseReleaseEvent(QMouseEvent *event)
|
void OverviewView::mouseReleaseEvent(QMouseEvent *event)
|
||||||
|
@ -98,6 +98,11 @@ private:
|
|||||||
*/
|
*/
|
||||||
void adjustScale();
|
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
|
* @brief base background color changing depending on the theme
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user