Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Refactor dashed line code to use the new Path APIs #36

Open
Hixie opened this issue Apr 5, 2018 · 5 comments
Open

Refactor dashed line code to use the new Path APIs #36

Hixie opened this issue Apr 5, 2018 · 5 comments
Assignees

Comments

@Hixie
Copy link

Hixie commented Apr 5, 2018

/// Draws dashed lines lines between each point.

We can probably do better (for dashed lines) now that we expose the path measuring API.

@mit-mit
Copy link
Member

mit-mit commented Apr 17, 2018

cc @cbbraun

@cbbraun
Copy link
Contributor

cbbraun commented Apr 17, 2018

Hixie, Can you point us to details or APIs?

@cbbraun cbbraun assigned cbbraun, Hixie and lorrainekan and unassigned cbbraun Apr 17, 2018
@Hixie
Copy link
Author

Hixie commented Apr 20, 2018

We had to revert it unfortunately, but it'll eventually be flutter/engine#4957.

@Hixie
Copy link
Author

Hixie commented May 8, 2018

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.

@dnfield
Copy link

dnfield commented May 9, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants