From 6d0005d95f20a326fe308a7c59dd2801f0d0b241 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Sat, 26 Apr 2014 19:13:31 +0200 Subject: fdo#74336 draw hairline if line width is small RenderPolygonStrokePrimitive2D draws a simple hairline if the line width is less than 1.0 (and less than 1.5 if no AA is used) so in tryDrawPolygonStrokePrimitive2DDirect we need to reflect this behaviour - otherwise the lines are drawn too small. Change-Id: Icd3d8f35a00346b1d624b6df010f43ed21968d04 --- drawinglayer/source/processor2d/vclpixelprocessor2d.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drawinglayer') diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx index 73d12f3ebedc..1a4db9512bd5 100644 --- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx @@ -237,6 +237,16 @@ namespace drawinglayer fLineWidth = aLineWidth.getLength(); } + // draw simple hairline for small line widths + // see also RenderPolygonStrokePrimitive2D which is used if this try fails + bool bIsAntiAliasing = getOptionsDrawinglayer().IsAntiAliasing(); + if ( (basegfx::fTools::lessOrEqual(fLineWidth, 1.0) && bIsAntiAliasing) + || (basegfx::fTools::lessOrEqual(fLineWidth, 1.5) && !bIsAntiAliasing)) + { + // draw simple hairline + fLineWidth = 0.0; + } + bool bHasPoints(false); bool bTryWorked(false); -- cgit v1.2.3