[Poppler-bugs] [Bug 105692] PDF compliance: Always respect Annot Rect

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Apr 6 10:04:29 UTC 2018


https://bugs.freedesktop.org/show_bug.cgi?id=105692

--- Comment #14 from Albert Astals Cid <aacid at kde.org> ---
(In reply to Tobias Deiminger from comment #13)
> (In reply to Albert Astals Cid from comment #12)
> > Comments either from you or from anyone else that add pros for this patch
> > are also welcome :)
> The size fix (not submitted yet) for the remaining types like AnnotLine and
> AnnotPolygonfrom will probably look something like this:
>  void Annot::getRect(double *x1, double *y1, double *x2, double *y2) const {
> -  *x1 = rect->x1;
> -  *y1 = rect->y1;
> -  *x2 = rect->x2;
> -  *y2 = rect->y2;
> +  PDFRectangle drawRect = getDrawRect();
> +  *x1 = drawRect.x1;
> +  *y1 = drawRect.y1;
> +  *x2 = drawRect.x2;
> +  *y2 = drawRect.y2;
>  }
> 
> I.e. always report the actually drawn size instead of the size stored in
> /Rect, because it can differ in corner cases and the drawn size is what's
> more important to API clients. That measure is only possible if there exists
> that getDrawRect method from attachment 138645 [details] [review]. That
> would be a (however still fictional) pro from my point of view.

Thinking about this, i really think if we're going to go that route, it's
better to kill appearBBox as a member, just use it to when we're creating the
new appearance and then adjust the rect member.

I don't like having the getrect function not really returning the rect member,
i've looked at the code and seems we really use rect for drawing and
geometrical stuff (i.e. inRect) so it should be fine updating it in my opinion.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler-bugs/attachments/20180406/465658ef/attachment.html>


More information about the Poppler-bugs mailing list