Shift the latest moveto command instead of the first (which can belong to a different component of the path). Additionally, do this only if the first 'segment' is a line. Fixes #4709.