From ffa1c7bc86093b8445656bab1538939b9d3a6d88 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Thu, 21 Jul 2016 11:10:53 +0200 Subject: tdf#101026 Create more correct replacement control vector Change-Id: I909adaab3dca3c1bac4331b164343cdbc1205df2 Reviewed-on: https://gerrit.libreoffice.org/27365 Tested-by: Jenkins Reviewed-by: Noel Grandin Reviewed-by: Armin Le Grand --- canvas/source/cairo/cairo_canvashelper.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'canvas/source/cairo') diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx index cd9a79ed6245..46f71a17820e 100644 --- a/canvas/source/cairo/cairo_canvashelper.cxx +++ b/canvas/source/cairo/cairo_canvashelper.cxx @@ -1026,16 +1026,18 @@ namespace cairocanvas // tdf#99165 if the control points are 'empty', create the mathematical // correct replacement ones to avoid problems with the graphical sub-system - if(basegfx::fTools::equal(nAX, nLastX) && basegfx::fTools::equal(nAY, nLastY)) + // 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 (basegfx::fTools::equal(nAX, nLastX) && basegfx::fTools::equal(nAY, nLastY)) { - nAX = nLastX + ((nBX - nLastX) * 0.3); - nAY = nLastY + ((nBY - nLastY) * 0.3); + nAX = nLastX + ((nBX - nLastX) * 0.0005); + nAY = nLastY + ((nBY - nLastY) * 0.0005); } if(basegfx::fTools::equal(nBX, nX) && basegfx::fTools::equal(nBY, nY)) { - nBX = nX + ((nAX - nX) * 0.3); - nBY = nY + ((nAY - nY) * 0.3); + nBX = nX + ((nAX - nX) * 0.0005); + nBY = nY + ((nAY - nY) * 0.0005); } cairo_curve_to( pCairo, nAX, nAY, nBX, nBY, nX, nY ); -- cgit