Skip to content

Commit 465e5fe

Browse files
committed
Removed unwanted move around of marker linking first and last data point in
polar coordinates during animation.
1 parent 28064eb commit 465e5fe

File tree

4 files changed

+92
-62
lines changed

4 files changed

+92
-62
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
- Fixed unintentional size change of circle markers during polar-cartesian
99
coordinate system change and animation from/to treemap.
1010
- Fixed line width animation when geometry is changing.
11+
- Removed unwanted move around of marker linking first and last data point in
12+
polar coordinates during animation.
1113

1214
## [0.5.1] - 2022-07-14
1315

src/chart/rendering/items/areaitem.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,21 @@ AreaItem::AreaItem(const Diag::Marker &marker,
3535
if (prev)
3636
{
3737
auto prevSpacing = prev->spacing * prev->size / 2;
38-
auto prevPos = prev->position - prevSpacing;
38+
auto prevPos = prev->position;
39+
40+
if ((double)options.polar.get() > 0)
41+
{
42+
if ((double)options.horizontal.get() > 0.5)
43+
{
44+
if (prevPos.x >= 1) prevPos.x -= 1;
45+
}
46+
else
47+
{
48+
if (prevPos.y >= 1) prevPos.y -= 1;
49+
}
50+
}
51+
52+
prevPos = prevPos - prevSpacing;
3953

4054
points[3] = prevPos;
4155

src/chart/rendering/items/lineitem.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,21 @@ LineItem::LineItem(const Diag::Marker &marker,
4040
if (prev)
4141
{
4242
auto prevSpacing = prev->spacing * prev->size / 2;
43-
auto prevPos = prev->position - prevSpacing;
43+
auto prevPos = prev->position;
44+
45+
if ((double)options.polar.get() > 0)
46+
{
47+
if ((double)options.horizontal.get() > 0.5)
48+
{
49+
if (prevPos.x >= 1) prevPos.x -= 1;
50+
}
51+
else
52+
{
53+
if (prevPos.y >= 1) prevPos.y -= 1;
54+
}
55+
}
56+
57+
prevPos = prevPos - prevSpacing;
4458

4559
lineWidth[0] = std::max(maxWidth * prev->sizeFactor, minWidth);
4660

0 commit comments

Comments
 (0)