servo / pathfinder

A fast, practical GPU rasterizer for fonts and vector graphics
Apache License 2.0
3.54k stars 198 forks source link

Contour: Print no-op parts for alternate debug format #473

Open inferiorhumanorgans opened 2 years ago

inferiorhumanorgans commented 2 years ago

I'm working on a project where I'd like to print out the whole contour even if it's just a no-op (to maintain compatibility with an external project). It looks like there's already code in place to allow this conditionally, so what I propose is that the alternate debug implementation prints the whole string while the default debug maintains the current behavior.

Thoughts?

Given:

let mut path = Path2D::new();
path.move_to(Vector2F::new(1., 1.));
let path_string = path.into_outline();

Expect:

assert_eq!(format!("{:?}", path_string), " z");

// This would be new behavior
assert_eq!(format!("{:#?}", path_string), "M 1 1 L 1 1 z");