This repository has been archived by the owner on Jan 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Refactor dashed line code to use the new Path APIs #36
Comments
cc @cbbraun |
Hixie, Can you point us to details or APIs? |
We had to revert it unfortunately, but it'll eventually be flutter/engine#4957. |
Ok, it's landed. Given a Path that you want to dash, you can call computeMetrics on that Path, iterate over the returned list of PathMetric objects, and for each PathMetric object, use extractPath to grab all the Path for each dash. You can then add all those subpaths to a single Path use addPath, and draw the whole thing use drawPath. |
I have an implementation here: https://github.com/dnfield/flutter_path_drawing/blob/master/lib/src/dash_path.dart Available on pub https://pub.dartlang.org/packages/path_drawing |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
charts/charts_flutter/lib/src/canvas/line_painter.dart
Line 81 in 2f1ad24
We can probably do better (for dashed lines) now that we expose the path measuring API.
The text was updated successfully, but these errors were encountered: