Simpler path tracing implementation

Use PathMeasure.getSegment() instead of a PathEffect.
This change shouldn’t make a difference in terms of performance but it
makes the code easier to follow.