mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-23 03:10:01 +08:00
Fix: box drawing comparison.
There was a bug. Converting the bitfield to int using the union wasn't working correctly.
This commit is contained in:
parent
84287eb217
commit
66cdf9b2a5
@ -98,16 +98,21 @@ struct TileEncoding {
|
|||||||
unsigned int down : 2;
|
unsigned int down : 2;
|
||||||
unsigned int round : 1;
|
unsigned int round : 1;
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
bool operator<(const TileEncoding& other) const {
|
bool operator<(const TileEncoding& other) const {
|
||||||
union Converter {
|
if (left < other.left) return true;
|
||||||
TileEncoding input;
|
if (left > other.left) return false;
|
||||||
uint16_t output = 0;
|
if (top < other.top) return true;
|
||||||
};
|
if (top > other.top) return false;
|
||||||
Converter a, b;
|
if (right < other.right) return true;
|
||||||
a.input = *this;
|
if (right > other.right) return false;
|
||||||
b.input = other;
|
if (down < other.down) return true;
|
||||||
return a.output < b.output;
|
if (down > other.down) return false;
|
||||||
|
if (round < other.round) return true;
|
||||||
|
if (round > other.round) return false;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
// clang-format on
|
||||||
};
|
};
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
|
Loading…
Reference in New Issue
Block a user