[Libreoffice-bugs] [Bug 113449] New: numerical inconsistency in basegfx::utils::isInside() causes wrong clipping in PDF export
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Wed Oct 25 16:33:42 UTC 2017
https://bugs.documentfoundation.org/show_bug.cgi?id=113449
Bug ID: 113449
Summary: numerical inconsistency in basegfx::utils::isInside()
causes wrong clipping in PDF export
Product: LibreOffice
Version: 6.0.0.0.alpha0+ Master
Hardware: All
OS: All
Status: UNCONFIRMED
Keywords: filter:pdf
Severity: normal
Priority: medium
Component: graphics stack
Assignee: libreoffice-bugs at lists.freedesktop.org
Reporter: mstahl at redhat.com
CC: Armin.Le.Grand at me.com
exporting the LO conference 2017 template to PDF results in wrong clipping on
the Agenda page: there should be a vertical clip of the green group shape on
the left, but the actual result is an un-clipped shape that extends into the
text box as a triangle.
the PDF should contain this on the 2nd shape exported from drawPolyPolygon:
0 0 307.5 595.2 re
+W* n
but it's missing because the m_aClipRegion is empty at that point, because
intersectClipRegion of these PolyPolygons results in [0:], i.e. empty:
% XXX aOld [1:<4:(0,0)--(3075.02,0)--(3075.02,5952.76)--(0,5952.76)>]
% XXX aRegion
[1:<4:(-1276.72,-62.0787)--(3075.02,-62.0787)--(3075.02,6108.38)--(-1276.72,6108.38)>]
this is because of an inconsistency in basegfx::utils::isInside()
where isPointOnPolygon returns false (so it's not on the edge)
but then bCompXA is also false (because it's detected as equal to the edge),
so the isInside() wrongly returns false.
the problem is caused by a tiny difference in X,
3075.0236220472434 vs 3075.0236220472439
involved objects:
(rr) p *rCandidate.mpPolygon.m_pimpl
$33 = {
m_value = {
maPoints = {
maVector = std::__debug::vector of length 4, capacity 4 = {{
<basegfx::B2DPoint> = {
<basegfx::B2DTuple> = {
mfX = -1276.724409448819,
mfY = -62.078740157480311
}, <No data fields>}, <No data fields>}, {
<basegfx::B2DPoint> = {
<basegfx::B2DTuple> = {
mfX = 3075.0236220472439,
mfY = -62.078740157480311
}, <No data fields>}, <No data fields>}, {
<basegfx::B2DPoint> = {
<basegfx::B2DTuple> = {
mfX = 3075.0236220472439,
mfY = 6108.3779527559054
}, <No data fields>}, <No data fields>}, {
<basegfx::B2DPoint> = {
<basegfx::B2DTuple> = {
mfX = -1276.724409448819,
mfY = 6108.3779527559054
}, <No data fields>}, <No data fields>}}
},
mpControlVector = std::unique_ptr<ControlVectorArray2D> containing 0x0,
mpBufferedData = std::unique_ptr<ImplBufferedData> containing 0x7eee920,
mbIsClosed = true
},
m_ref_count = 5
}
(rr) p aCurrentPoint
$40 = {
<basegfx::B2DTuple> = {
mfX = 3075.0236220472439,
mfY = 6108.3779527559054
}, <No data fields>}
(rr) p aPreviousPoint
$41 = {
<basegfx::B2DTuple> = {
mfX = 3075.0236220472439,
mfY = -62.078740157480311
}, <No data fields>}
(rr) p rPoint
$34 = (const basegfx::B2DPoint &) @0x7ffcc8ab2af0: {
<basegfx::B2DTuple> = {
mfX = 3075.0236220472434,
mfY = 0
}, <No data fields>}
the PDF export changed with commit 581806182ac7da81115c9675b4e828688178aa04
but it was differently wrong before that commit, the particular shape in the
group shape was missing completely, and there is no problem with the commit.
--
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/libreoffice-bugs/attachments/20171025/28283505/attachment.html>
More information about the Libreoffice-bugs
mailing list