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

New: Add method to get top right corner of a highlight annotation #340

Merged
merged 2 commits into from
Aug 29, 2017

Conversation

pramodsum
Copy link
Contributor

@pramodsum pramodsum commented Aug 25, 2017

This is required to flip the annotations dialog above highlight annotations

Copy link
Contributor

@Minh-Ng Minh-Ng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I am curious about a couple things.

Why are quad points being used when a rectangle can be calculated using the top left and bottom right points?
Will getTopRightCornerOfLastQuadPoint ever be called with an undefined value or an empty array? If so what happens?

@pramodsum
Copy link
Contributor Author

It should ever get called with an undefined value or empty array. It will be used similar to how getLowerRightCornerOfLastQuadPoint is used to position the dialog on a highlight. The method it's being called in should deal w/ any kind of quad point validation if needed.

As far as I know, we used the quad points to calculate where to position the highlights because that's how they're being stored in annotation thread and that's what we end up having access to in the dialog.

@pramodsum pramodsum merged commit 75b183d into box:master Aug 29, 2017
@JustinHoldstock
Copy link
Contributor

@minhhnguyen @pramodsum Also, AFAIK we store the points as per the PDF annotations spec.

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

Successfully merging this pull request may close these issues.

3 participants