Skip to content

Commit

Permalink
fix(tier4_state_rviz_plugin): fix bugprone-integer-division (#9628)
Browse files Browse the repository at this point in the history
fix: bugprone-integer-division

Signed-off-by: kobayu858 <[email protected]>
  • Loading branch information
kobayu858 authored Dec 12, 2024
1 parent 1d9a2be commit 46cfadb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void CustomContainer::paintEvent(QPaintEvent *)

// Draw background
QPainterPath path;
path.addRoundedRect(rect(), height() / 2, height() / 2); // Use height for rounded corners
path.addRoundedRect(rect(), height() / 2.0, height() / 2.0); // Use height for rounded corners
painter.setPen(Qt::NoPen);
painter.setBrush(QColor(
autoware::state_rviz_plugin::colors::default_colors.surface.c_str())); // Background color
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void CustomIconLabel::paintEvent(QPaintEvent *)

// Draw background circle
QPainterPath path;
path.addEllipse(width() / 2 - radius, height() / 2 - radius, diameter, diameter);
path.addEllipse(width() / 2.0 - radius, height() / 2.0 - radius, diameter, diameter);
painter.setPen(Qt::NoPen);
painter.setBrush(backgroundColor);
painter.drawPath(path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void CustomSegmentedButton::paintEvent(QPaintEvent *)

// Draw background
QPainterPath path;
path.addRoundedRect(rect(), height() / 2, height() / 2);
path.addRoundedRect(rect(), height() / 2.0, height() / 2.0);

painter.setPen(Qt::NoPen);
painter.setBrush(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void CustomSegmentedButtonItem::paintEvent(QPaintEvent *)
}

QPainterPath path;
double radius = (height() - 2) / 2;
double radius = (height() - 2.0) / 2.0;

path.setFillRule(Qt::WindingFill);
if (isFirstButton) {
Expand Down

0 comments on commit 46cfadb

Please sign in to comment.