diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-07-27 16:03:48 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-07-28 18:09:10 +0200 |
commit | f62c65459100bd45bfc274e2b2587d5c6804feb2 (patch) | |
tree | dabc17be4da16b5427aea3b95cdd244c852218ed /drawinglayer/source/primitive2d | |
parent | 7202cfa0d3bae430f8fcb8508ed389583a14539b (diff) |
borderline: corrections for calc and writer
Made corrections/finetuning for Calc and Writer.
Had to remove some former code which tried to do
corrections.
Change-Id: Id9fc687b9a709d250faaad76c37ecfda8d8feb9b
Diffstat (limited to 'drawinglayer/source/primitive2d')
-rw-r--r-- | drawinglayer/source/primitive2d/borderlineprimitive2d.cxx | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx index 724ba8772c44..dae52a26f0c6 100644 --- a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx @@ -49,6 +49,10 @@ namespace drawinglayer { } + BorderLine::~BorderLine() + { + } + bool BorderLine::operator==(const BorderLine& rBorderLine) const { return getWidth() == rBorderLine.getWidth() @@ -104,13 +108,17 @@ namespace drawinglayer // double line with gap. Use mfDiscreteGapDistance (see get2DDecomposition) as distance. // That value is prepared to be at least one pixel (discrete unit) so that the // decomposition is view-dependent in this cases + const BorderLine& rLeft(getBorderLines()[0]); + const BorderLine& rGap(getBorderLines()[1]); + const BorderLine& rRight(getBorderLines()[2]); + const double fFullWidth(rLeft.getWidth() + mfDiscreteGapDistance + rRight.getWidth()); + { - // inside line (left of vector). Create stroke primitive centered on line width - const BorderLine& rLeft(getBorderLines()[0]); - const double fDeltaY((mfDiscreteGapDistance + rLeft.getWidth()) * 0.5); + // inside line (left of vector). Create stroke primitive centered on left line width + const double fDeltaY((rLeft.getWidth() - fFullWidth) * 0.5); const basegfx::B2DVector aDeltaY(aPerpendicular * fDeltaY); - const basegfx::B2DPoint aStart(getStart() - (aVector * rLeft.getExtendStart()) - aDeltaY); - const basegfx::B2DPoint aEnd(getEnd() + (aVector * rLeft.getExtendEnd()) - aDeltaY); + const basegfx::B2DPoint aStart(getStart() - (aVector * rLeft.getExtendStart()) + aDeltaY); + const basegfx::B2DPoint aEnd(getEnd() + (aVector * rLeft.getExtendEnd()) + aDeltaY); const attribute::LineAttribute aLineAttribute(rLeft.getRGBColor(), rLeft.getWidth()); addPolygonStrokePrimitive2D( @@ -124,10 +132,11 @@ namespace drawinglayer if (hasGapColor()) { // gap (if visible, found practical usage in Writer MultiColorBorderLines). - // Create stroke primitive on vector with given color - const BorderLine& rGap(getBorderLines()[1]); - const basegfx::B2DPoint aStart(getStart() - (aVector * rGap.getExtendStart())); - const basegfx::B2DPoint aEnd(getEnd() + (aVector * rGap.getExtendEnd())); + // Create stroke primitive on vector with given color centered on gap position + const double fDeltaY(((fFullWidth - mfDiscreteGapDistance) * 0.5) - rRight.getWidth()); + const basegfx::B2DVector aDeltaY(aPerpendicular * fDeltaY); + const basegfx::B2DPoint aStart(getStart() - (aVector * rGap.getExtendStart()) + aDeltaY); + const basegfx::B2DPoint aEnd(getEnd() + (aVector * rGap.getExtendEnd()) + aDeltaY); const attribute::LineAttribute aLineAttribute(rGap.getRGBColor(), mfDiscreteGapDistance); addPolygonStrokePrimitive2D( @@ -139,9 +148,8 @@ namespace drawinglayer } { - // outside line (right of vector). Create stroke primitive centered on line width - const BorderLine& rRight(getBorderLines()[2]); - const double fDeltaY((mfDiscreteGapDistance + rRight.getWidth()) * 0.5); + // outside line (right of vector). Create stroke primitive centered on right line width + const double fDeltaY((fFullWidth - rRight.getWidth()) * 0.5); const basegfx::B2DVector aDeltaY(aPerpendicular * fDeltaY); const basegfx::B2DPoint aStart(getStart() - (aVector * rRight.getExtendStart()) + aDeltaY); const basegfx::B2DPoint aEnd(getEnd() + (aVector * rRight.getExtendEnd()) + aDeltaY); |