'Flutter, paint free hand point header position got misplaced
I am developing a flutter application. In that am using Paint to draw lines. In free hand line the point header is correctly displaying when we draw a straight line. But when we rotate the line, the point header position got misplaced.
case PaintMode.freeStyleArrow:
for (var i = 0; i < _offset!.length - 1; i++) {
if (_offset[i] != null && _offset[i + 1] != null) {
final _path = Path()
..moveTo(_offset[i]!.dx, _offset[i]!.dy)
..lineTo(_offset[i + 1]!.dx, _offset[i + 1]!.dy);
canvas.drawPath(_path, _painter!..strokeCap = StrokeCap.round);
paintsFreestyleArrow(canvas,_offset[0]!, _offset[_offset.length - 2]!, _painter, size);
}
else if (_offset[i] != null && _offset[i + 1] == null) {
canvas.drawPoints(PointMode.points, [_offset[i]!],
_painter!);
}}
break;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|


