diff options
author | Regina Henschel <rb.henschel@t-online.de> | 2011-09-03 01:20:54 +0200 |
---|---|---|
committer | Thorsten Behrens <tbehrens@novell.com> | 2011-09-03 01:26:09 +0200 |
commit | 33996edb390e74f203fec4651eb641e4029c27e7 (patch) | |
tree | 7baaa9d867c1a387c44181c8ccdb30537aaa94a7 /drawinglayer/source | |
parent | bc0a497f08d52450fd74c6372c9f6780f6715e40 (diff) |
Fix wrong line end positioning
fix fdo#40529 - if you have line ends that are *not* filled,
the polygon overlaps with the line end marker. Adapted calculation
in drawing layer to have that sorted out.
Diffstat (limited to 'drawinglayer/source')
-rw-r--r-- | drawinglayer/source/primitive2d/polygonprimitive2d.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx index 6a656445db40..1b7c2ce55c20 100644 --- a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx @@ -519,6 +519,8 @@ namespace drawinglayer const double fPolyLength(basegfx::tools::getLength(aLocalPolygon)); double fStart(0.0); double fEnd(0.0); + double fStartOverlap(0.0); + double fEndOverlap(0.0); if(!getStart().isDefault() && getStart().isActive()) { @@ -527,8 +529,9 @@ namespace drawinglayer aLocalPolygon, getStart().getB2DPolyPolygon(), true, getStart().getWidth(), fPolyLength, getStart().isCentered() ? 0.5 : 0.0, &fStart); - // create some overlapping - fStart *= 0.8; + // create some overlapping, compromise between straight and peaked markers + // for marker width 0.3cm and marker line width 0.02cm + fStartOverlap = getStart().getWidth() / 15.0; } if(!getEnd().isDefault() && getEnd().isActive()) @@ -539,13 +542,13 @@ namespace drawinglayer fPolyLength, getEnd().isCentered() ? 0.5 : 0.0, &fEnd); // create some overlapping - fEnd *= 0.8; + fEndOverlap = getEnd().getWidth() / 15.0; } if(0.0 != fStart || 0.0 != fEnd) { // build new poly, consume something from old poly - aLocalPolygon = basegfx::tools::getSnippetAbsolute(aLocalPolygon, fStart, fPolyLength - fEnd, fPolyLength); + aLocalPolygon = basegfx::tools::getSnippetAbsolute(aLocalPolygon, fStart-fStartOverlap, fPolyLength - fEnd + fEndOverlap, fPolyLength); } } |