From b370e5a8f8df8cd6827ddb99b958d6a00642035e Mon Sep 17 00:00:00 2001 From: Jane Liu Date: Wed, 16 Aug 2017 13:24:58 -0400 Subject: Fixed the return values of FPDFAnnot_Get{Rect|AttachmentPoints} Currently, FPDFAnnot_Get{Rect|AttachmentPoints} would return BBox if the annotation's appearance stream is defined, which does not make much sense to the user since BBox is defined in the form space; upon rendering, the annotation's position in the device space is solely defined by its rectangle. This CL removes references to BBox in FPDFAnnot_Get{Rect| AttachmentPoints}; instead, they will only return rectangle or quadpoints as requested. The embedder test is also modified to reflect this change, and also to demonstrate that an annotation's position is changed only if its rectangle is changed. Bug=pdfium:861 Change-Id: I489876511aa5d93131dd695170d46bbc49d16574 Reviewed-on: https://pdfium-review.googlesource.com/11050 Commit-Queue: Jane Liu Reviewed-by: dsinclair --- public/fpdf_annot.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'public') diff --git a/public/fpdf_annot.h b/public/fpdf_annot.h index 1de99453fc..6cd06dd9db 100644 --- a/public/fpdf_annot.h +++ b/public/fpdf_annot.h @@ -283,7 +283,8 @@ FPDFAnnot_HasAttachmentPoints(FPDF_ANNOTATION annot); // Experimental API. // Set the attachment points (i.e. quadpoints) of an annotation. If the // annotation's appearance stream is defined and this annotation is of a type -// with quadpoints, then update the bounding box too. +// with quadpoints, then update the bounding box too if the new quadpoints +// define a bigger one. // // annot - handle to an annotation. // quadPoints - the quadpoints to be set. @@ -294,9 +295,7 @@ FPDFAnnot_SetAttachmentPoints(FPDF_ANNOTATION annot, const FS_QUADPOINTSF* quadPoints); // Experimental API. -// Get the attachment points (i.e. quadpoints) of an annotation. If the -// annotation's appearance stream is defined and this annotation is of a type -// with quadpoints, then return the bounding box it specifies instead. +// Get the attachment points (i.e. quadpoints) of an annotation. // // annot - handle to an annotation. // quadPoints - receives the quadpoints; must not be NULL. @@ -309,7 +308,8 @@ FPDFAnnot_GetAttachmentPoints(FPDF_ANNOTATION annot, // Experimental API. // Set the annotation rectangle defining the location of the annotation. If the // annotation's appearance stream is defined and this annotation is of a type -// without quadpoints, then update the bounding box too. +// without quadpoints, then update the bounding box too if the new rectangle +// defines a bigger one. // // annot - handle to an annotation. // rect - the annotation rectangle to be set. @@ -319,9 +319,7 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetRect(FPDF_ANNOTATION annot, const FS_RECTF* rect); // Experimental API. -// Get the annotation rectangle defining the location of the annotation. If the -// annotation's appearance stream is defined and this annotation is of a type -// without quadpoints, then return the bounding box it specifies instead. +// Get the annotation rectangle defining the location of the annotation. // // annot - handle to an annotation. // rect - receives the rectangle; must not be NULL. -- cgit v1.2.3