Skip to content

Commit d4ab0e7

Browse files
authored
Merge pull request #592 from vizzuhq/bugfix_250
Flying out marker label fixed.
2 parents e46e2e3 + 63f81ce commit d4ab0e7

File tree

4 files changed

+49
-4
lines changed

4 files changed

+49
-4
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- Removed 'min' align property from the API which equivalent with the 'none'.
88
- Markers are the same even if new record added.
9+
- Flying out marker label fixed.
910
- Axis line hide/show at same time with axis labels/ticks/title.
1011
- Do not draw invisible axis line.
1112

src/base/geom/rect.cpp

+14-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <algorithm>
44
#include <array>
55
#include <cmath>
6+
#include <compare>
67

78
#include "base/math/floating.h"
89

@@ -92,10 +93,19 @@ Rect Rect::intersection(const Rect &rect) const
9293

9394
bool Rect::intersects(const Rect &r) const
9495
{
95-
using Math::Floating::less;
96-
auto isOutside =
97-
less(right(), r.left()) || less(r.right(), left())
98-
|| less(top(), r.bottom()) || less(r.top(), bottom());
96+
using Math::Floating::is_zero;
97+
using std::strong_order;
98+
auto first = strong_order(right(), r.left());
99+
auto second = strong_order(r.right(), left());
100+
auto third = strong_order(top(), r.bottom());
101+
auto fourth = strong_order(r.top(), bottom());
102+
103+
auto isOutside = is_lt(first) || is_lt(second) || is_lt(third)
104+
|| is_lt(fourth)
105+
|| ((is_eq(first) || is_eq(second))
106+
&& !is_zero(width()) && !is_zero(r.width()))
107+
|| ((is_eq(third) || is_eq(fourth))
108+
&& !is_zero(height()) && !is_zero(r.height()));
99109
return !isOutside;
100110
}
101111

test/e2e/tests/fixes.json

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
"163": {
2020
"refs": ["a82431f"]
2121
},
22+
"250": {
23+
"refs": ["e140a3d"]
24+
},
2225
"252": {
2326
"refs": ["00f01d9"]
2427
},

test/e2e/tests/fixes/250.mjs

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const testSteps = [
2+
(chart) =>
3+
chart.animate({
4+
data: {
5+
series: [
6+
{ name: 'Foo', values: ['Alice', 'Bob', 'Ted'] },
7+
{ name: 'Bar', values: [15, 32, 12] },
8+
{ name: 'Baz', values: [5, 3, 2] }
9+
]
10+
}
11+
}),
12+
(chart) =>
13+
chart.animate({
14+
config: {
15+
x: 'Foo',
16+
y: 'Bar',
17+
label: 'Bar'
18+
}
19+
}),
20+
(chart) =>
21+
chart.animate({
22+
config: {
23+
x: { range: { min: -2, max: 2 } }
24+
},
25+
style: {
26+
paddingRight: 100
27+
}
28+
})
29+
]
30+
31+
export default testSteps

0 commit comments

Comments
 (0)