onroad ui: fix opacity affecting other drawn icons (#26378)

* save painter in drawIcon

* fix

* Update selfdrive/ui/qt/onroad.cc
old-commit-hash: ed3bf4f123
taco
Shane Smiskol 3 years ago committed by GitHub
parent e8c6795a36
commit 1627a41a68
  1. 1
      selfdrive/ui/qt/onroad.cc

@ -404,6 +404,7 @@ void AnnotatedCameraWidget::drawText(QPainter &p, int x, int y, const QString &t
} }
void AnnotatedCameraWidget::drawIcon(QPainter &p, int x, int y, QPixmap &img, QBrush bg, float opacity) { void AnnotatedCameraWidget::drawIcon(QPainter &p, int x, int y, QPixmap &img, QBrush bg, float opacity) {
p.setOpacity(1.0); // bg dictates opacity of ellipse
p.setPen(Qt::NoPen); p.setPen(Qt::NoPen);
p.setBrush(bg); p.setBrush(bg);
p.drawEllipse(x - radius / 2, y - radius / 2, radius, radius); p.drawEllipse(x - radius / 2, y - radius / 2, radius, radius);

Loading…
Cancel
Save