Skip to content

Commit 3d5f038

Browse files
committed
Fixed milestone text rendering position.
1 parent 5e4e6b6 commit 3d5f038

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/layered_chart.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class LayeredChart extends StatefulWidget {
1515
double animationValue;
1616

1717
LayeredChart(this.dataToPlot, this.milestones, animationValue) {
18-
this.animationValue = animationValue;
18+
this.animationValue = 1;//animationValue;
1919
}
2020

2121
@override
@@ -243,8 +243,9 @@ class ChartPainter extends CustomPainter {
243243
canvas.drawLine(new Offset(x1, y1), new Offset(x2, y2), milestonePaint);
244244
canvas.save();
245245
TextPainter tp = state.milestonePainter[i];
246-
canvas.translate(textX - tp.width / 2, textY);
246+
canvas.translate(textX, textY);
247247
canvas.skew(capTheta * 1.0, -theta);
248+
canvas.translate(-tp.width / 2, 0);
248249
tp.paint(canvas, new Offset(0, 0));
249250
canvas.restore();
250251
}

0 commit comments

Comments
 (0)