Commit 9153e7bb authored by Lex Berezhny's avatar Lex Berezhny

update playfair to match flutter/painting module refactoring

parent 9b46c2d8
......@@ -9,5 +9,6 @@ import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/painting.dart';
part 'src/base.dart';
......@@ -171,7 +171,7 @@ class ChartPainter {
..maxWidth = _rect.width
..layout();
_horizontalGridlines.add(gridline);
yScaleWidth = math.max(yScaleWidth, gridline.labelPainter.maxContentWidth);
yScaleWidth = math.max(yScaleWidth, gridline.labelPainter.maxWidth);
}
yScaleWidth += kScaleMargin;
......@@ -190,7 +190,7 @@ class ChartPainter {
gridline.end = _convertPointToRectSpace(new Point(data.endX, gridline.value), markerRect);
gridline.labelPosition = new Point(
gridline.end.x + kScaleMargin,
gridline.end.y - gridline.labelPainter.height / 2.0
gridline.end.y - gridline.labelPainter.size.height / 2.0
);
}
......@@ -218,8 +218,8 @@ class ChartPainter {
..maxWidth = markerRect.width
..layout();
_indicator.labelPosition = new Point(
((_indicator.start.x + _indicator.end.x) / 2.0) - _indicator.labelPainter.maxContentWidth / 2.0,
_indicator.start.y - _indicator.labelPainter.height - kIndicatorMargin
((_indicator.start.x + _indicator.end.x) / 2.0) - _indicator.labelPainter.maxWidth / 2.0,
_indicator.start.y - _indicator.labelPainter.size.height - kIndicatorMargin
);
}
} else {
......@@ -256,7 +256,7 @@ class ChartPainter {
canvas.drawCircle(marker, kMarkerRadius, paint);
path.lineTo(marker.x, marker.y);
}
paint.setStyle(ui.PaintingStyle.stroke);
paint.style = ui.PaintingStyle.stroke;
canvas.drawPath(path, paint);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment