Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page.rotate API is potentially confusing/violates expectations #467

Open
jbarlow83 opened this issue Apr 8, 2023 · 1 comment
Open

Page.rotate API is potentially confusing/violates expectations #467

jbarlow83 opened this issue Apr 8, 2023 · 1 comment

Comments

@jbarlow83
Copy link
Member

A page will have Page.Rotate, which is the variable, and page.rotate(), which is our wrapper around QPDFPageObjectHelper::rotatePage.

It might be more intuitive for .rotate to be a property, like the various bounding boxes are, or to rename .rotate to something like .apply_rotation() since it has parameters.

@jbarlow83 jbarlow83 changed the title Page.rotate is weird Page.rotate API is potentially confusing/violates expectations May 14, 2023
@m-holger
Copy link
Contributor

Looking at the various boxes, to me the intuitive solution would be to have a rotate property where the getter uses getAttribute to get the effective /Rotate and the setter uses the existing rotate with relative = False, with a separate rotate_relative method.

The really intuitive solution would be to have a Rotate object and implement relative rotation as an augmented assignment, i.e as page.rotate += 90 or page.rotate -= 90, although this feels like a bit of overkill.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants