mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-06 22:22:11 +08:00
cabana: optimize chart update (#26327)
optimize update old-commit-hash: 4c90bb8635d460c1a574f3ab3d7aa264179c197e
This commit is contained in:
@@ -325,7 +325,6 @@ void ChartView::updateLineMarker(double current_sec) {
|
||||
chart()->plotArea().width() * (current_sec - axis_x->min()) / (axis_x->max() - axis_x->min());
|
||||
if (int(line_marker->line().x1()) != x) {
|
||||
line_marker->setLine(x, 0, x, height());
|
||||
chart()->update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -410,6 +409,7 @@ void ChartView::mouseReleaseEvent(QMouseEvent *event) {
|
||||
} else {
|
||||
QGraphicsView::mouseReleaseEvent(event);
|
||||
}
|
||||
setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate);
|
||||
}
|
||||
|
||||
void ChartView::mouseMoveEvent(QMouseEvent *ev) {
|
||||
@@ -436,6 +436,8 @@ void ChartView::mouseMoveEvent(QMouseEvent *ev) {
|
||||
track_line->setVisible(value != vals.end());
|
||||
value_text->setVisible(value != vals.end());
|
||||
track_ellipse->setVisible(value != vals.end());
|
||||
} else {
|
||||
setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
|
||||
}
|
||||
QChartView::mouseMoveEvent(ev);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user