|
3 | 3 | #include <algorithm> |
4 | 4 | #include <cmath> |
5 | 5 | #include <cstddef> |
6 | | -#include <ranges> |
| 6 | +#include <iterator> |
| 7 | +#include <map> |
7 | 8 | #include <utility> |
8 | 9 |
|
9 | 10 | #include "base/anim/interpolated.h" |
|
12 | 13 | #include "base/gfx/colortransform.h" |
13 | 14 | #include "base/math/floating.h" |
14 | 15 | #include "base/math/fuzzybool.h" |
| 16 | +#include "base/math/interpolation.h" |
15 | 17 | #include "base/math/range.h" |
16 | | -#include "base/math/renard.h" |
17 | 18 | #include "base/text/smartstring.h" |
18 | 19 | #include "base/type/booliter.h" |
19 | 20 | #include "chart/generator/plot.h" // NOLINT(misc-include-cleaner) |
@@ -65,7 +66,7 @@ void DrawInterlacing::drawGeometries(Gen::AxisId axisIndex) const |
65 | 66 | othGuides.interlacings); |
66 | 67 | } |
67 | 68 |
|
68 | | - auto orientation = !++axisIndex; |
| 69 | + auto orientation = !Gen::orientation(axisIndex); |
69 | 70 |
|
70 | 71 | parent.painter.setPolygonToCircleFactor(0); |
71 | 72 | parent.painter.setPolygonStraightFactor(0); |
@@ -143,7 +144,7 @@ void DrawInterlacing::drawGeometries(Gen::AxisId axisIndex) const |
143 | 144 | void DrawInterlacing::drawTexts(Gen::AxisId axisIndex) const |
144 | 145 | { |
145 | 146 | const auto &axis = parent.getAxis(axisIndex).measure; |
146 | | - auto orientation = !++axisIndex; |
| 147 | + auto orientation = !Gen::orientation(axisIndex); |
147 | 148 | auto origo = parent.origo().getCoord(orientation); |
148 | 149 | const auto &guides = parent.plot->guides.at(axisIndex); |
149 | 150 | const auto &axisStyle = parent.rootStyle.plot.getAxis(axisIndex); |
@@ -212,7 +213,7 @@ void DrawInterlacing::drawDataLabel( |
212 | 213 | const ::Anim::String &unit, |
213 | 214 | double alpha) const |
214 | 215 | { |
215 | | - auto orientation = !++axisIndex; |
| 216 | + auto orientation = !Gen::orientation(axisIndex); |
216 | 217 | const auto &labelStyle = |
217 | 218 | parent.rootStyle.plot.getAxis(axisIndex).label; |
218 | 219 |
|
@@ -283,12 +284,13 @@ void DrawInterlacing::drawSticks(double tickLength, |
283 | 284 | canvas.setLineWidth(*tickStyle.lineWidth); |
284 | 285 |
|
285 | 286 | auto tickLine = tickStyle.position->combine( |
286 | | - [tickLine = |
287 | | - parent.coordSys |
288 | | - .convertDirectionAt({tickPos, |
289 | | - tickPos |
290 | | - + Geom::Point::Coord(!++axisIndex, -1.0)}) |
291 | | - .segment(0, tickLength)](const auto &position) |
| 287 | + [tickLine = parent.coordSys |
| 288 | + .convertDirectionAt({tickPos, |
| 289 | + tickPos |
| 290 | + + Geom::Point::Coord( |
| 291 | + !orientation(axisIndex), |
| 292 | + -1.0)}) |
| 293 | + .segment(0, tickLength)](const auto &position) |
292 | 294 | { |
293 | 295 | switch (position) { |
294 | 296 | using enum Styles::Tick::Position; |
|
0 commit comments