diff options
author | Tomofumi Yagi <yagit@mknada.sakura.ne.jp> | 2011-10-20 11:03:54 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2011-10-20 11:05:17 +0200 |
commit | 8c2902ecbf135fae070ea032fa10a59bb76ec1b0 (patch) | |
tree | 7b87fcb52ef5eddf9998b9b4fee2652ec7959b8a /drawinglayer/source | |
parent | 8eb50d3b4be4df15f830e4b36449c9fcf05aa71b (diff) |
fdo#37129: Fix the drawing of dotted and dashed borders in Calc.
Diffstat (limited to 'drawinglayer/source')
-rw-r--r-- | drawinglayer/source/primitive2d/borderlineprimitive2d.cxx | 9 | ||||
-rw-r--r-- | drawinglayer/source/processor2d/vclprocessor2d.cxx | 7 |
2 files changed, 13 insertions, 3 deletions
diff --git a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx index 9738e14b503d..df6f381c69ec 100644 --- a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx @@ -29,6 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_drawinglayer.hxx" +#include <drawinglayer/geometry/viewinformation2d.hxx> #include <drawinglayer/primitive2d/borderlineprimitive2d.hxx> #include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx> #include <basegfx/polygon/b2dpolygon.hxx> @@ -79,7 +80,7 @@ namespace drawinglayer return basegfx::B2DPolyPolygon( clipPolygon ); } - Primitive2DSequence BorderLinePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + Primitive2DSequence BorderLinePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const { Primitive2DSequence xRetval; @@ -214,6 +215,7 @@ namespace drawinglayer // Get which is the line to show bool bIsHairline = leftIsHairline(); + bool bIsSolidline = isSolidLine(); double nWidth = getCorrectedLeftWidth(); basegfx::BColor aColor = getRGBColorLeft(); if ( basegfx::fTools::equal( 0.0, mfLeftWidth ) ) @@ -223,7 +225,7 @@ namespace drawinglayer aColor = getRGBColorRight(); } - if(bIsHairline) + if(bIsHairline && bIsSolidline) { // create hairline primitive aPolygon.append( getStart() ); @@ -237,12 +239,13 @@ namespace drawinglayer { // create filled polygon primitive const basegfx::B2DVector aLineWidthOffset(((nWidth + 1) * 0.5) * aPerpendicular); + basegfx::B2DVector aScale( rViewInformation.getInverseObjectToViewTransformation() * aVector ); aPolygon.append( aTmpStart ); aPolygon.append( aTmpEnd ); basegfx::B2DPolyPolygon aDashed = svtools::ApplyLineDashing( - aPolygon, getStyle(), MAP_100TH_MM ); + aPolygon, getStyle(), MAP_PIXEL, aScale.getLength() ); for (sal_uInt32 i = 0; i < aDashed.count(); i++ ) { basegfx::B2DPolygon aDash = aDashed.getB2DPolygon( i ); diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index a13ca70f948e..c02151987643 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -837,6 +837,10 @@ namespace drawinglayer } else { + // remember that we enter a PolygonStrokePrimitive2D decomposition, + // used for AA thick line drawing + mnPolygonStrokePrimitive2D++; + mpOutputDevice->DrawPolyPolygon(aLocalPolyPolygon); if(mnPolygonStrokePrimitive2D @@ -854,6 +858,9 @@ namespace drawinglayer mpOutputDevice->DrawPolyLine(aLocalPolyPolygon.getB2DPolygon(a), 0.0); } } + + // leave PolygonStrokePrimitive2D + mnPolygonStrokePrimitive2D--; } } |