diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2016-07-21 11:10:53 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2016-07-28 09:42:07 +0000 |
commit | ffa1c7bc86093b8445656bab1538939b9d3a6d88 (patch) | |
tree | 1013244466da96c92c7c9907dd1d3d62547b787c /vcl | |
parent | 11ded42ef7f056072e7bf1fb66a0e1ec5a556317 (diff) |
tdf#101026 Create more correct replacement control vector
Change-Id: I909adaab3dca3c1bac4331b164343cdbc1205df2
Reviewed-on: https://gerrit.libreoffice.org/27365
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/headless/svpgdi.cxx | 8 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salgdi.cxx | 8 | ||||
-rw-r--r-- | vcl/win/gdi/gdiimpl.cxx | 13 |
3 files changed, 16 insertions, 13 deletions
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index 7482a68da7dc..af26bd13bbc5 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -651,14 +651,16 @@ static void AddPolygonToPath(cairo_t* cr, const basegfx::B2DPolygon& rPolygon, b // tdf#99165 if the control points are 'empty', create the mathematical // correct replacement ones to avoid problems with the graphical sub-system - if(aCP1.equal(aLast)) + // tdf#101026 The 1st attempt to create a mathematically correct replacement control + // vector was wrong. Best alternative is one as close as possible which means short. + if (aCP1.equal(aLast)) { - aCP1 = aLast + ((aCP2 - aLast) * 0.3); + aCP1 = aLast + ((aCP2 - aLast) * 0.0005); } if(aCP2.equal(aPoint)) { - aCP2 = aPoint + ((aCP1 - aPoint) * 0.3); + aCP2 = aPoint + ((aCP1 - aPoint) * 0.0005); } cairo_curve_to(cr, aCP1.getX(), aCP1.getY(), aCP2.getX(), aCP2.getY(), diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx index 66c9e6248bbc..72daa7165bc3 100644 --- a/vcl/unx/generic/gdi/salgdi.cxx +++ b/vcl/unx/generic/gdi/salgdi.cxx @@ -825,14 +825,16 @@ bool X11SalGraphics::drawPolyLine( // miter graphics (and maybe others) when empty control points // are used, so fallback to the mathematical 'default' control // points in that case - if(aStart.equal(aCP1)) + // tdf#101026 The 1st attempt to create a mathematically correct replacement control + // vector was wrong. Best alternative is one as close as possible which means short. + if (aStart.equal(aCP1)) { - aCP1 = aStart + ((aCP2 - aStart) * 0.3); + aCP1 = aStart + ((aCP2 - aStart) * 0.0005); } if(aEnd.equal(aCP2)) { - aCP2 = aEnd + ((aCP1 - aEnd) * 0.3); + aCP2 = aEnd + ((aCP1 - aEnd) * 0.0005); } cairo_curve_to(cr, diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx index 09c63f554799..996822259d01 100644 --- a/vcl/win/gdi/gdiimpl.cxx +++ b/vcl/win/gdi/gdiimpl.cxx @@ -1925,19 +1925,18 @@ void impAddB2DPolygonToGDIPlusGraphicsPathReal( // tdf#99165 MS Gdiplus cannot handle creating correct extra geometry for fat lines // with LineCap or LineJoin when a bezier segment starts or ends trivial, e.g. has // no 1st or 2nd control point, despite that these are mathematicaly correct definitions - // (basegfx can handle that). To solve, create replacement vectors to thre resp. next - // control point with 1/3rd of length (the default control vector for these cases). - // Only one of this can happen here, else the is(Next|Prev)ControlPointUsed wopuld have - // both been false. + // (basegfx can handle that). // Caution: This error (and it's correction) might be necessary for other graphical - // sub-systems in a similar way + // sub-systems in a similar way. + // tdf#101026 The 1st attempt to create a mathematically correct replacement control + // vector was wrong. Best alternative is one as close as possible which means short. if(!b1stControlPointUsed) { - aCa = aCurr + ((aCb - aCurr) * 0.3); + aCa = aCurr + ((aCb - aCurr) * 0.0005); } else if(!b2ndControlPointUsed) { - aCb = aNext + ((aCa - aNext) * 0.3); + aCb = aNext + ((aCa - aNext) * 0.0005); } rGraphicsPath.AddBezier( |