Implementing SVG attribute "stroke-miterlimit" ( tdf#48066)

Regina Henschel rb.henschel at
Thu Apr 7 12:35:31 UTC 2016

Hi all,

I have made some progress. But a new problem comes up.

I have changed WinSalGraphicsImpl::drawPolyLine [3] so that it gets an 
additional parameter fMiterMinimumAngle (same meaning as in 
createAreaGeometryForJoin) and uses it for gdi+. The rendering in 
edit-mode in Draw and Impress is correct then with gdi+ on Windows. Even 
Text in SVG works out of the box. [BTW: The current rendering using gdi+ 
is wrong, see my report bug#99102.]

The behavior of gdi+ is described in [1]. To get the same kind of 
behavior as in LO, when the miter limit is exceeded, the LineJoin type 
'LineJoinMiterClipped' has to be used.

Being only in LibreOffice and SVG, that would be no problem. But MS 
seems to use different defaults. The rendering in PowerPoint looks like 
gdi+ type 'LineJoinMiter'. The specification for 'lim' in ECMA-376, Part 
1, chapter, has no details, and I have not found details 

This gdi+ type 'LineJoinMiter' kind of clipping (see the image in the 
article [1]) will be used in SVG 2 [2] too under the identifier 

So my question: Ignore interoperability with MS? If not, how to solve it?

Kind regards



diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx
index 7febbe8..36ecb31 100644
--- a/vcl/win/gdi/gdiimpl.cxx
+++ b/vcl/win/gdi/gdiimpl.cxx
@@ -2031,7 +2031,8 @@ bool WinSalGraphicsImpl::drawPolyLine(
      double fTransparency,
      const basegfx::B2DVector& rLineWidths,
      basegfx::B2DLineJoin eLineJoin,
-    css::drawing::LineCap eLineCap)
+    css::drawing::LineCap eLineCap,
+    double fMiterMinimumAngle)
      const sal_uInt32 nCount(rPolygon.count());

@@ -2064,9 +2065,9 @@ bool WinSalGraphicsImpl::drawPolyLine(
              case basegfx::B2DLineJoin::Miter :
-                const Gdiplus::REAL aMiterLimit(15.0);
+                const Gdiplus::REAL 
-                Gdiplus::DllExports::GdipSetPenLineJoin(pTestPen, 
+                Gdiplus::DllExports::GdipSetPenLineJoin(pTestPen, 
              case basegfx::B2DLineJoin::Round :

More information about the LibreOffice mailing list