Skip to content

Commit 46cfadb

Browse files
authored
fix(tier4_state_rviz_plugin): fix bugprone-integer-division (#9628)
fix: bugprone-integer-division Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>
1 parent 1d9a2be commit 46cfadb

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

visualization/tier4_state_rviz_plugin/src/custom_container.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void CustomContainer::paintEvent(QPaintEvent *)
5151

5252
// Draw background
5353
QPainterPath path;
54-
path.addRoundedRect(rect(), height() / 2, height() / 2); // Use height for rounded corners
54+
path.addRoundedRect(rect(), height() / 2.0, height() / 2.0); // Use height for rounded corners
5555
painter.setPen(Qt::NoPen);
5656
painter.setBrush(QColor(
5757
autoware::state_rviz_plugin::colors::default_colors.surface.c_str())); // Background color

visualization/tier4_state_rviz_plugin/src/custom_icon_label.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void CustomIconLabel::paintEvent(QPaintEvent *)
6565

6666
// Draw background circle
6767
QPainterPath path;
68-
path.addEllipse(width() / 2 - radius, height() / 2 - radius, diameter, diameter);
68+
path.addEllipse(width() / 2.0 - radius, height() / 2.0 - radius, diameter, diameter);
6969
painter.setPen(Qt::NoPen);
7070
painter.setBrush(backgroundColor);
7171
painter.drawPath(path);

visualization/tier4_state_rviz_plugin/src/custom_segmented_button.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void CustomSegmentedButton::paintEvent(QPaintEvent *)
6666

6767
// Draw background
6868
QPainterPath path;
69-
path.addRoundedRect(rect(), height() / 2, height() / 2);
69+
path.addRoundedRect(rect(), height() / 2.0, height() / 2.0);
7070

7171
painter.setPen(Qt::NoPen);
7272
painter.setBrush(

visualization/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ void CustomSegmentedButtonItem::paintEvent(QPaintEvent *)
125125
}
126126

127127
QPainterPath path;
128-
double radius = (height() - 2) / 2;
128+
double radius = (height() - 2.0) / 2.0;
129129

130130
path.setFillRule(Qt::WindingFill);
131131
if (isFirstButton) {

0 commit comments

Comments
 (0)