Skip to content

Commit f2a862e

Browse files
committed
Remove align max
1 parent d4576d6 commit f2a862e

File tree

2 files changed

+7
-20
lines changed

2 files changed

+7
-20
lines changed

src/apps/weblib/typeschema-api/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ definitions:
223223
on where the measure is. In case both axes have measures on them, this is determined
224224
by the `orientation` of the chart.
225225
type: string
226-
enum: [none, min, center, max, stretch]
226+
enum: [none, min, center, stretch]
227227
split:
228228
description: |
229229
If set to true, markers will be split by the dimension(s) along the axis.

src/chart/options/align.h

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,17 @@ namespace Vizzu::Base
1010

1111
struct Align : private Math::Range<double>
1212
{
13-
public:
14-
enum class Type : std::uint8_t {
15-
none,
16-
min,
17-
center,
18-
max,
19-
stretch
20-
};
21-
22-
Align(Type type, const Range<double> &range) :
23-
Range<double>(range),
24-
type(type)
25-
{}
26-
27-
[[nodiscard]] Range<double> getAligned(
28-
const Range<double> &range) const
13+
enum class Type : std::uint8_t { none, min, center, stretch };
14+
15+
Align(Type type, const Range &range) : Range(range), type(type) {}
16+
17+
[[nodiscard]] Range getAligned(const Range &range) const
2918
{
3019
switch (type) {
3120
case Type::none: return range;
3221
case Type::min: return range + min - range.getMin();
3322
case Type::center: return range - range.middle() + middle();
34-
case Type::max: return range + max - range.getMax();
35-
case Type::stretch:
36-
return static_cast<const Range<double> &>(*this);
23+
case Type::stretch: return static_cast<const Range &>(*this);
3724
}
3825
throw std::logic_error("invalid align type");
3926
}

0 commit comments

Comments
 (0)