From dbf84e82cc9f5033c944402e16c1035e58cdc334 Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Wed, 22 Mar 2006 09:17:24 +0000 Subject: INTEGRATION: CWS vcl55 (1.77.50); FILE MERGED 2006/03/15 10:36:05 pl 1.77.50.2: solved a Windows compile problem 2006/02/27 14:30:57 pl 1.77.50.1: #i62424# add linejoint and miterlimit to SvtGraphicsStroke --- svx/source/svdraw/svdobj.cxx | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'svx/source/svdraw/svdobj.cxx') diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index b2f4cf87de9a..79e53d979adb 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -4,9 +4,9 @@ * * $RCSfile: svdobj.cxx,v $ * - * $Revision: 1.77 $ + * $Revision: 1.78 $ * - * last change: $Author: kz $ $Date: 2006-02-01 19:01:54 $ + * last change: $Author: obo $ $Date: 2006-03-22 10:17:24 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -37,6 +37,7 @@ #include #endif +#define _USE_MATH_DEFINES #include #include // fuer TakeContour #include @@ -1260,14 +1261,33 @@ void SdrObject::ImpDrawLineGeometry( XOutputDevice& rXOut, //BFS09 SvtGraphicStroke aStroke( XOutCreatePolygonBezier( aPolyPoly[0] ), //BFS09 XOutCreatePolygonBezier( aStartPoly ), //BFS09 XOutCreatePolygonBezier( aEndPoly ), + SvtGraphicStroke::JoinType eJoin; + double fMiterLength = rLineParameters.GetLineWidth(); + switch( rLineParameters.GetLineJoint() ) + { + case XLINEJOINT_NONE: eJoin = SvtGraphicStroke::joinNone;break; + case XLINEJOINT_MIDDLE: + case XLINEJOINT_MITER: + { + eJoin = SvtGraphicStroke::joinMiter; + // assume GetLinejointMiterMinimumAngle returns degrees (currently returns 15.0) + double fSin = rtl::math::sin( M_PI * rLineParameters.GetLinejointMiterMinimumAngle() / 360.0 ); + if( ! rtl::math::isNan( fSin ) ) + fMiterLength /= fSin; + } + break; + case XLINEJOINT_BEVEL: eJoin = SvtGraphicStroke::joinBevel;break; + default: + case XLINEJOINT_ROUND: eJoin = SvtGraphicStroke::joinRound;break; + } SvtGraphicStroke aStroke( static_cast(aPolyPoly[0].getB2DPolygon()), Polygon(aStartPoly.getB2DPolygon()), Polygon(aEndPoly.getB2DPolygon()), nTransparence / 100.0, rLineParameters.GetLineWidth(), SvtGraphicStroke::capButt, - SvtGraphicStroke::joinRound, - rLineParameters.GetLinejointMiterMinimumAngle(), + eJoin, + fMiterLength, //BFS06 rLineParameters.GetLineStyle() == XLINE_DASH ? rLineParameters.GetDotDash() : SvtGraphicStroke::DashArray() ); rLineParameters.IsLineStyleSolid() ? SvtGraphicStroke::DashArray() : rLineParameters.GetDotDash() ); -- cgit