Skip to content

Commit 9239524

Browse files
committed
Fix a bug + add changelog + change tests
1 parent 5bf2ded commit 9239524

File tree

7 files changed

+538
-529
lines changed

7 files changed

+538
-529
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
- Axis: line, title, labels, guides, interlacing, ticks
1111
- Legend: title, dimension markers, measure extrema labels
1212
- Marker: line with connections
13+
- Fix negative ranges on x, y, color (measure) and lightness.
14+
- Fix axis step parameter if not match with the range sign (neg/pos).
15+
- Fix axis interpolation. From now the axis and axis labels are following the markers.
16+
- Fix measure axis labels when the range started after the 2000th step value from origo.
1317

1418
### Added
1519

src/chart/generator/axis.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#include "axis.h"
22

33
#include <algorithm>
4+
#include <cmath>
5+
#include <limits>
46
#include <map>
57
#include <optional>
68
#include <string>

src/chart/rendering/drawinterlacing.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "base/geom/rect.h"
1111
#include "base/gfx/colortransform.h"
1212
#include "base/gfx/font.h"
13+
#include "base/math/floating.h"
1314
#include "base/math/range.h"
1415
#include "base/math/renard.h"
1516
#include "base/text/smartstring.h"
@@ -140,9 +141,11 @@ void DrawInterlacing::draw(
140141

141142
auto axisBottom = axis.origo() + stripWidth;
142143

143-
auto iMin = axisBottom > 0 ? static_cast<int>(
144-
std::floor(-axis.origo() / (2 * stripWidth)))
145-
: 0;
144+
auto iMin =
145+
axisBottom > 0 ? static_cast<int>(
146+
std::floor(-axis.origo() / (2 * stripWidth)))
147+
: static_cast<int>(
148+
(axis.range.getMin() - stepSize) / 2);
146149

147150
if (stripWidth <= 0) return;
148151
auto interlaceCount = 0U;

0 commit comments

Comments
 (0)