|
1 | 1 | #include "marker.h" |
2 | 2 |
|
| 3 | +#include <cmath> |
3 | 4 | #include <cstdint> |
4 | 5 | #include <optional> |
5 | 6 | #include <utility> |
@@ -31,10 +32,10 @@ Marker::Marker(const Options &options, |
31 | 32 | bool needMarkerInfo) : |
32 | 33 | cellInfo(data.cellInfo(index, needMarkerInfo)), |
33 | 34 | mainId(data.getId(mainAxisList, |
34 | | - options.dimLabelIndex(-options.mainAxisType()), |
| 35 | + options.dimLabelIndex(+options.mainAxisType()), |
35 | 36 | index)), |
36 | 37 | subId(data.getId(subAxisList, |
37 | | - options.dimLabelIndex(-options.subAxisType()), |
| 38 | + options.dimLabelIndex(+options.subAxisType()), |
38 | 39 | index)), |
39 | 40 | sizeId(data.getId( |
40 | 41 | options.getChannels().at(ChannelId::size).dimensions(), |
@@ -76,7 +77,7 @@ Marker::Marker(const Options &options, |
76 | 77 | if (subAxisList != options.subAxis().dimensions()) |
77 | 78 | subId.label = |
78 | 79 | data.getId(options.subAxis().dimensions(), |
79 | | - options.dimLabelIndex(-options.subAxisType()), |
| 80 | + options.dimLabelIndex(+options.subAxisType()), |
80 | 81 | index) |
81 | 82 | .label; |
82 | 83 |
|
@@ -223,14 +224,14 @@ void Marker::fromRectangle(const Geom::Rect &rect) |
223 | 224 |
|
224 | 225 | Math::Range<> Marker::getSizeBy(AxisId axisId) const |
225 | 226 | { |
226 | | - return isHorizontal(+axisId) ? toRectangle().hSize() |
227 | | - : toRectangle().vSize(); |
| 227 | + return isHorizontal(orientation(axisId)) ? toRectangle().hSize() |
| 228 | + : toRectangle().vSize(); |
228 | 229 | } |
229 | 230 |
|
230 | 231 | void Marker::setSizeBy(AxisId axisId, const Math::Range<> range) |
231 | 232 | { |
232 | 233 | auto rect = toRectangle(); |
233 | | - if (isHorizontal(+axisId)) |
| 234 | + if (isHorizontal(orientation(axisId))) |
234 | 235 | rect.setHSize(range); |
235 | 236 | else |
236 | 237 | rect.setVSize(range); |
|
0 commit comments