mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-05 21:42:05 +08:00
cabana: restrict the rubber band in plot area. (#27154)
old-commit-hash: fba4827a7b9c6441cf85799770503229a361667f
This commit is contained in:
@@ -656,7 +656,16 @@ void ChartView::mouseMoveEvent(QMouseEvent *ev) {
|
||||
} else {
|
||||
QToolTip::hideText();
|
||||
}
|
||||
|
||||
QChartView::mouseMoveEvent(ev);
|
||||
if (is_zooming) {
|
||||
QRect rubber_rect = rubber->geometry();
|
||||
rubber_rect.setLeft(std::max(rubber_rect.left(), (int)plot_area.left()));
|
||||
rubber_rect.setRight(std::min(rubber_rect.right(), (int)plot_area.right()));
|
||||
if (rubber_rect != rubber->geometry()) {
|
||||
rubber->setGeometry(rubber_rect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ChartView::dragMoveEvent(QDragMoveEvent *event) {
|
||||
|
||||
Reference in New Issue
Block a user