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

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Apr 6 12:19:22 UTC 2018


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

--- Comment #15 from Tobias Deiminger <haxtibal at posteo.de> ---
(In reply to Albert Astals Cid from comment #14)
> 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.
Yeah, I thought about that already. I hesitated a bit, maybe you can help. It's
this: We can't use Annot::setRect to adjust the rect member, because this (a)
also creates an adjusted annotObj["Rect"] Object, and (b) calls
invalidateAppearance.
(a) would cause the size change to be saved into the document which I think
would be an unexpected side effect
(b) would invalidate our just created appearance, so we never get an valid
appearance

If we instead bypass Annot::setRect on appearance creation and update
Annot::rect directly, it could work. But I have not yet checked for side
effects of Annot::rect != Annot::annotObj["Rect"]. If there's no side effect
then we should be able to do what you suggested and discard both the
Annot::appearBBox member and the Annot::getDrawRect method and as a bonus
things are simplified a bit.

> 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.
In places such as inRect we would have to use getDrawRect() instead of
Annot::rect too, to be consistent. But if your suggestion above works, we don't
have to bother anyway.

-- 
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/187daf7f/attachment.html>


More information about the Poppler-bugs mailing list