Skip to content

Commit b48b368

Browse files
committed
Fix clang-tidy
1 parent 90d5c70 commit b48b368

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

src/chart/rendering/drawinterlacing.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,17 @@ void DrawInterlacing::draw(
145145

146146
auto axisBottom = axis.origo() + stripWidth;
147147

148-
auto iMin = axisBottom > 0
149-
? std::floor(-axis.origo() / (2 * stripWidth))
150-
: (axis.range.getMin() - stepSize) / 2;
148+
auto iMin =
149+
axisBottom > 0
150+
? std::floor(-axis.origo() / (2 * stripWidth)) * 2
151+
: axis.range.getMin() - stepSize;
151152

152153
auto interlaceCount = 0U;
153154
const auto maxInterlaceCount = 1000U;
154-
for (double i = iMin; ++interlaceCount <= maxInterlaceCount;
155-
i += 1) {
156-
auto bottom = axisBottom + i * 2 * stripWidth;
155+
for (auto i = static_cast<int>(iMin);
156+
++interlaceCount <= maxInterlaceCount;
157+
i += 2) {
158+
auto bottom = axisBottom + i * stripWidth;
157159
if (bottom > 1.0) break;
158160
auto clippedBottom = bottom;
159161
auto top = bottom + stripWidth;
@@ -175,7 +177,7 @@ void DrawInterlacing::draw(
175177
canvas.setFont(Gfx::Font{axisStyle.label});
176178

177179
if (!clipBottom) {
178-
auto value = (i * 2 + 1) * stepSize;
180+
auto value = (i + 1) * stepSize;
179181
auto tickPos =
180182
rect.bottomLeft().comp(!horizontal)
181183
+ origo.comp(horizontal);
@@ -195,7 +197,7 @@ void DrawInterlacing::draw(
195197
}
196198
if (singleLabelRange) break;
197199
if (!clipTop) {
198-
auto value = (i * 2 + 2) * stepSize;
200+
auto value = (i + 2) * stepSize;
199201
auto tickPos =
200202
rect.topRight().comp(!horizontal)
201203
+ origo.comp(horizontal);

src/chart/rendering/drawlegend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
#include "base/gfx/colortransform.h"
1717
#include "base/gfx/draw/roundedrect.h"
1818
#include "base/gfx/lineargradient.h"
19-
#include "base/math/floating.h"
2019
#include "base/math/fuzzybool.h"
20+
#include "base/math/range.h"
2121
#include "base/text/smartstring.h"
2222
#include "chart/generator/plot.h" // NOLINT(misc-include-cleaner)
2323
#include "chart/main/events.h"

test/e2e/tests/config_tests.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"refs": ["b26b94f"]
6060
},
6161
"channel_ranges/meas_axis": {
62-
"refs": ["de2669f"]
62+
"refs": ["71d11f5"]
6363
}
6464
}
6565
}

0 commit comments

Comments
 (0)