[Libreoffice-commits] .: drawinglayer/source
Thorsten Behrens
thorsten at kemper.freedesktop.org
Fri Sep 2 16:26:34 PDT 2011
drawinglayer/source/primitive2d/polygonprimitive2d.cxx | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
New commits:
commit 33996edb390e74f203fec4651eb641e4029c27e7
Author: Regina Henschel <rb.henschel at t-online.de>
Date: Sat Sep 3 01:20:54 2011 +0200
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.
diff --git a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
index 6a65644..1b7c2ce 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);
}
}
More information about the Libreoffice-commits
mailing list