ssimms / pdfapi2

Create, modify, and examine PDF files in Perl
Other
15 stars 20 forks source link

Understanding translate #45

Closed sciurius closed 2 years ago

sciurius commented 2 years ago

I cannot understand the results of the attached program.

The first part behaves as if the transformation is relative, even though relative => $rel with $rel = 0.

The scond part displays the big crosshairs at the expected place, but the other transformations act if relative to ???

The last magenta crosshairs seems to be translated [20,10] w.r.t the previous blue crosshairs, despite the save/restore.

I must be missing something very fundamental (stupid...)?

translate.zip

ssimms commented 2 years ago

The documentation was incorrect. See the referenced change above for what it actually does, which I had misunderstood when documenting it.

Coordinate transformations are always relative, so "relative" meant "relative to the previous set of arguments" rather than "relative to the previous coordinates". I've renamed the boolean to be "repeat", which should hopefully prevent that confusion in the future. It's useful for step-based transformations.

sciurius commented 2 years ago

Thanks. That explains a lot.