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

Regina Henschel rb.henschel at
Fri Apr 1 16:26:28 UTC 2016

Hi Armin,

Armin Le Grand schrieb:
> Hi Regina,
> the MiterMinimumAngle influences only the miter mode, thus I do not
> understand the 'still not changed to Bevel' comment.

I mean, when I set a breakpoint in createAreaGeometryForJoin, which is 
called from createAreaGeometry, then I see, that this function will 
indeed be hit and the value in double fMiterMinimumAngle is that one, 
that it should be according to the SVG source. And in 
createAreaGeometryForJoin, there is a case distinction which switches to 
B2DLineJoin::Bevel in case the current angle is smaller as 
fMiterMinimumAngle. So I had expected, that nothing more was needed.

  In SVG import, the
> primitives and thus the LineAttribute as part of it containing the
> MiterMinimumAngle is directly created, the exactly same instance will be
> used in the renderer and be available in the decomposition.

So you saw, adapting the way through 
PolygonStrokePrimitive2D::create2DDecomposition is not enough and I have 
to change the renderers parallel?

> I am not sure at which system you are,

only Windows

  but the value needs to be used
> either in
>      VclPixelProcessor2D::tryDrawPolygonStrokePrimitive2DDirect
> and then handed through
>      OutputDevice::DrawPolyLineDirect
> like the other values, down to the renderer sal implementation (Gdiplus
> for windows).

It seems, that part is missing.

> Or - when getting decomposed in
>      PolygonStrokePrimitive2D::create2DDecomposition
> and then handed over to
>      basegfx::tools::createAreaGeometry
> also like the other values.

There the value arrived.

  Thus, still some hand-through
> implementations needed to pass the value to the places where needed. At
> that places, currently a default is used.
> basegfx::tools::createAreaGeometry has an input value for
> fMiterMinimumAngle already.

I have adapted the caller 
PolygonStrokePrimitive2D::create2DDecomposition already to use this 

> With OutputDevice::DrawPolyLineDirect it needs to be handed over to
> diverse implementations of DrawPolyLine, there seems to be one for
> OpenGLSalGraphicsImpl::DrawPolyLine
> SalGraphics::DrawPolyLine
> in principle all which use the same parameters (e.g. including
> basegfx::B2DLineJoin). For me, OpenGLSalGraphicsImpl is new and I am not
> sure how/where it is used.
> SalGraphics::DrawPolyLine uses SalGraphics::drawPolyLine (small 1st
> letter) which is
>      virtual bool                drawPolyLine(
>                                      const basegfx::B2DPolygon&,
>                                      double fTransparency,
>                                      const basegfx::B2DVector& rLineWidths,
>                                      basegfx::B2DLineJoin,
>                                      css::drawing::LineCap) = 0;
> and has diverse system-specific implementations that need to be adapted.
> In those implementations usually the default value for MiterMinimumAngle
> is used (see WinSalGraphicsImpl::drawPolyLine).
> Unfortunaltely it is not easy in vcl to do that, the compiler is your
> friend. It was already a lot of work to add methods to the whole chain
> that use more modern parameters. It is also necessary to adapt all
> implementations for all target plattforms and to test compilation on all
> plattforms, since this touches plattform-dependent code that is not
> built on all plattforms.

I first need to make it work on Windows.

> Theoretically it would also need to be added to MetaPolyLineAction, but
> the Metafile actions have the problem to be saved/loaded, so this is
> hard to to backwards compatible. You would need to create a new version
> of MetaPolyLineAction, see other examples with MetaActions.
> Hard stuff....
> I hope this helps!

Yes. I now see which parts to touch, but it will take some time. I am 
glad you take the time to guide me. Luckily it is not a feature, which 
is urgently needed.

Kind regards

> Regards,
> Armin
> Am 01.04.2016 um 16:04 schrieb Regina Henschel:
>> Hi,
>> Armin Le Grand schrieb:
>>> Hi Regina,
>>> Am 24.03.2016 um 16:35 schrieb Regina Henschel:
>>>> Hi Armin,
>>>> I need an advice/opinion _where_ to hold the information:
>>> Definitely in drawinglayer::attribute::LineAttribute, same place where
>>> basegfx::B2DLineJoin is held. A double, defaulted to 15.0 and read
>>> access will be fine. For setting it, add a 5th parameter to the
>>> constructor, defaulted to 15.0. The LineAttribute is a read-only, not
>>> later changeable class to keep things simple. It is better/safer to
>>> create another one when a value needs to be changed than starting to
>>> keep track of changes and add notification or other stuff.
>> I'm now at the stage, where createAreaGeometryForJoin() in
>> b2dlinegeometry is called with the correct angle in its parameter
>> fMiterMinimumAngle. But in the inserted svg image, the join is still
>> not changed to Bevel. What places do I need to change in addition? Is
>> there something to do in module canvas or vcl or something additional
>> in svgio or ...?
>> Kind regards
>> Regina
>> _______________________________________________
>> LibreOffice mailing list
>> LibreOffice at

More information about the LibreOffice mailing list