<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Regina,<br>
<br>
comments inline :-)<br>
<br>
<div class="moz-cite-prefix">Am 08.04.2016 um 18:27 schrieb Regina
Henschel:<br>
</div>
<blockquote cite="mid:5707DBDC.9060300@t-online.de" type="cite">Hi
Armin,
<br>
<br>
since yesterday I have thought about it. I now think, that I will
use the GDI+ type 'LineJoinMiterClipped'. That makes rendering
inside LO consistent and that is more important as
interoperability with foreign applications. It is then still
possible to implement the use of the GDI+ type 'LineJoinMiter' in
addition later on, and use it for pptx.
<br>
</blockquote>
<br>
I checked and agree - when the limit is exceeded, fallback to bevel
should happen. This is exactly what we do and what others do, e.g.
cairo:<br>
<br>
"If the current line join style is set to <a class="link"
href="http://www.cairographics.org/manual/cairo-cairo-t.html#CAIRO-LINE-JOIN-MITER:CAPS"><code
class="literal">CAIRO_LINE_JOIN_MITER</code></a>
(see <a class="link"
href="http://www.cairographics.org/manual/cairo-cairo-t.html#cairo-set-line-join"
title="cairo_set_line_join ()"><code class="function">cairo_set_line_join()</code></a>),
the miter limit is used to determine
whether the lines should be joined with a bevel instead of a miter.
Cairo divides the length of the miter by the line width.
If the result is greater than the miter limit, the style is
converted to a bevel."<br>
<br>
<blockquote cite="mid:5707DBDC.9060300@t-online.de" type="cite">
<br>
It is not a problem of scaling, but the kind how the sharp corner
is clipped is fundamental different.
<br>
</blockquote>
<br>
Yes, extending it somehow - instead of just doing a bevel it 'keeps'
some lengths - stragne ;.)<br>
<br>
<blockquote cite="mid:5707DBDC.9060300@t-online.de" type="cite">
<br>
If you think I should do it different, please tell me.
<br>
<br>
Next problem: When testing a curve I got bug
<br>
<a class="moz-txt-link-freetext" href="https://bugs.documentfoundation.org/show_bug.cgi?id=99165">https://bugs.documentfoundation.org/show_bug.cgi?id=99165</a>
Rendering of mitered curve changes with zoom level
<br>
That is independent of SVG, but effects the rendering of SVG too.
Do you have a code pointer, where I should look for the reason?
<br>
</blockquote>
<br>
I am surprised - and indeed, it is already in aoo. Sigh.<br>
Entry is in
VclPixelProcessor2D::tryDrawPolygonStrokePrimitive2DDirect, two
hits, 1st is the fat line, 2nd the hairline. This goes down to the
Gdiplus renderer WinSalGraphicsImpl::drawPolyLine which does<br>
<br>
const Gdiplus::REAL aMiterLimit(15.0);<br>
Gdiplus::DllExports::GdipSetPenMiterLimit(pTestPen,
aMiterLimit);<br>
Gdiplus::DllExports::GdipSetPenLineJoin(pTestPen,
Gdiplus::LineJoinMiter);<br>
<br>
If this does not work (hopefully better with LineJoinMiterClipped)
we have a problem with WIndows.<br>
BTW: jumping in the debugger over
tryDrawPolygonStrokePrimitive2DDirect in
VclPixelProcessor2D::processBasePrimitive2D and using the
decomposition works...<br>
<br>
Regards,<br>
Armin<br>
<br>
<blockquote cite="mid:5707DBDC.9060300@t-online.de" type="cite">
<br>
The state is now, that I have finished the transport of
fMiterMinimumAngle for Windows. The rendering is already good with
decomposition and with anti-aliasing on as well, here on Windows.
I have started to adapt the headers for the other OS. A
MetaXYAction is still missing.
<br>
<br>
Kind regards
<br>
Regina
<br>
<br>
Armin Le Grand schrieb:
<br>
<blockquote type="cite">Hi Regina,
<br>
<br>
yes, the MiterLimits are different in different systems, but all
are
<br>
somehow specified using the angle between the two vectors
involved. I
<br>
remember to have seen some definitions, most using the same and
15 as
<br>
default value. The ways to be compatible with MS are:
<br>
- find a definition somewhere, mqaybe in forums or newsgroups (I
have
<br>
none, sorry)
<br>
- reverse engineer by trying out. Probability is high that there
is a
<br>
(linear?) relationship between the values, so it might be a
simple scaling
<br>
HTH!
<br>
<br>
Regards,
<br>
Armin
<br>
<br>
Am 07.04.2016 um 14:35 schrieb Regina Henschel:
<br>
<blockquote type="cite">Hi all,
<br>
<br>
I have made some progress. But a new problem comes up.
<br>
<br>
I have changed WinSalGraphicsImpl::drawPolyLine [3] so that it
gets an
<br>
additional parameter fMiterMinimumAngle (same meaning as in
<br>
createAreaGeometryForJoin) and uses it for gdi+. The rendering
in
<br>
edit-mode in Draw and Impress is correct then with gdi+ on
Windows.
<br>
Even Text in SVG works out of the box. [BTW: The current
rendering
<br>
using gdi+ is wrong, see my report bug#99102.]
<br>
<br>
The behavior of gdi+ is described in [1]. To get the same kind
of
<br>
behavior as in LO, when the miter limit is exceeded, the
LineJoin type
<br>
'LineJoinMiterClipped' has to be used.
<br>
<br>
Being only in LibreOffice and SVG, that would be no problem.
But MS
<br>
seems to use different defaults. The rendering in PowerPoint
looks
<br>
like gdi+ type 'LineJoinMiter'. The specification for 'lim' in
<br>
ECMA-376, Part 1, chapter 20.1.8.43, has no details, and I
have not
<br>
found details otherwhere.
<br>
<br>
This gdi+ type 'LineJoinMiter' kind of clipping (see the image
in the
<br>
article [1]) will be used in SVG 2 [2] too under the
identifier
<br>
'miter-clip'.
<br>
<br>
So my question: Ignore interoperability with MS? If not, how
to solve it?
<br>
<br>
Kind regards
<br>
Regina
<br>
<br>
[1]
<br>
<a class="moz-txt-link-freetext" href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms534148%28v=vs.85%29.aspx">https://msdn.microsoft.com/en-us/library/windows/desktop/ms534148%28v=vs.85%29.aspx</a>
<br>
<br>
<br>
[2] <a class="moz-txt-link-freetext" href="https://www.w3.org/TR/svg-strokes/#StrokeShape">https://www.w3.org/TR/svg-strokes/#StrokeShape</a>
<br>
<br>
[3]
<br>
diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx
<br>
index 7febbe8..36ecb31 100644
<br>
--- a/vcl/win/gdi/gdiimpl.cxx
<br>
+++ b/vcl/win/gdi/gdiimpl.cxx
<br>
@@ -2031,7 +2031,8 @@ bool WinSalGraphicsImpl::drawPolyLine(
<br>
double fTransparency,
<br>
const basegfx::B2DVector& rLineWidths,
<br>
basegfx::B2DLineJoin eLineJoin,
<br>
- css::drawing::LineCap eLineCap)
<br>
+ css::drawing::LineCap eLineCap,
<br>
+ double fMiterMinimumAngle)
<br>
{
<br>
const sal_uInt32 nCount(rPolygon.count());
<br>
<br>
@@ -2064,9 +2065,9 @@ bool WinSalGraphicsImpl::drawPolyLine(
<br>
}
<br>
case basegfx::B2DLineJoin::Miter :
<br>
{
<br>
- const Gdiplus::REAL aMiterLimit(15.0);
<br>
+ const Gdiplus::REAL
<br>
aMiterLimit(1/sin(fMiterMinimumAngle/2.0));
<br>
Gdiplus::DllExports::GdipSetPenMiterLimit(pTestPen,
aMiterLimit);
<br>
-
Gdiplus::DllExports::GdipSetPenLineJoin(pTestPen,
<br>
Gdiplus::LineJoinMiter);
<br>
+
Gdiplus::DllExports::GdipSetPenLineJoin(pTestPen,
<br>
Gdiplus::LineJoinMiterClipped);
<br>
break;
<br>
}
<br>
case basegfx::B2DLineJoin::Round :
<br>
<br>
_______________________________________________
<br>
LibreOffice mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:LibreOffice@lists.freedesktop.org">LibreOffice@lists.freedesktop.org</a>
<br>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/libreoffice">https://lists.freedesktop.org/mailman/listinfo/libreoffice</a>
<br>
</blockquote>
<br>
</blockquote>
<br>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
--
ALG (PGP Key: EE1C 4B3F E751 D8BC C485 DEC1 3C59 F953 D81C F4A2)</pre>
</body>
</html>