Improve typing of PathPainter

For reasons I don't really understand, this fixes a collision with Images.
But in principle, this is a better way to design types anyway (particularly
for an immutable).