@@ -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);
0 commit comments