summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2012-11-06 16:39:47 +0200
committerTor Lillqvist <tml@iki.fi>2012-11-06 16:41:44 +0200
commitf354ba7a3aba1301f3951fdd9f74a38bd94255af (patch)
tree1ea81a550bd6ae4a2847b52fe064089fdead51af /vcl
parentb9c98414ec9084cf97b5dcc911fb9941b5e57ebb (diff)
Unbreak compilation of the iOS vcl code
Note that this is code basically copy-pasted from the MacOSX ("aqua") back-end with some small edits, and it is not clear at all that it will eventually be used in this form at all. But until then, let's keep it compiling. Change-Id: Ia1bd63f2ecc621cd4ce699ffc754cab423321d42
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/ios/salgdi.h8
-rw-r--r--vcl/ios/source/gdi/salgdicommon.cxx26
2 files changed, 31 insertions, 3 deletions
diff --git a/vcl/inc/ios/salgdi.h b/vcl/inc/ios/salgdi.h
index 4743c88fa9d9..9456d71fa047 100644
--- a/vcl/inc/ios/salgdi.h
+++ b/vcl/inc/ios/salgdi.h
@@ -123,8 +123,12 @@ public:
virtual sal_Bool drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry );
virtual sal_Bool drawPolyPolygonBezier( sal_uLong nPoly, const sal_uLong* pPoints,
const SalPoint* const* pPtAry, const sal_uInt8* const* pFlgAry );
- virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency,
- const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin );
+ virtual bool drawPolyLine(
+ const ::basegfx::B2DPolygon&,
+ double fTransparency,
+ const ::basegfx::B2DVector& rLineWidths,
+ basegfx::B2DLineJoin,
+ com::sun::star::drawing::LineCap eLineCap);
// CopyArea --> No RasterOp, but ClipRegion
virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth,
diff --git a/vcl/ios/source/gdi/salgdicommon.cxx b/vcl/ios/source/gdi/salgdicommon.cxx
index bba57352f799..8642a3504a64 100644
--- a/vcl/ios/source/gdi/salgdicommon.cxx
+++ b/vcl/ios/source/gdi/salgdicommon.cxx
@@ -662,7 +662,8 @@ void IosSalGraphics::drawPixel( long nX, long nY, SalColor nSalColor )
bool IosSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon& rPolyLine,
double fTransparency,
const ::basegfx::B2DVector& rLineWidths,
- basegfx::B2DLineJoin eLineJoin )
+ basegfx::B2DLineJoin eLineJoin,
+ com::sun::star::drawing::LineCap eLineCap )
{
// short circuit if there is nothing to do
const int nPointCount = rPolyLine.count();
@@ -694,6 +695,28 @@ bool IosSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon& rPolyLine,
case ::basegfx::B2DLINEJOIN_ROUND: aCGLineJoin = kCGLineJoinRound; break;
}
+ // setup cap attribute
+ CGLineCap aCGLineCap(kCGLineCapButt);
+
+ switch(eLineCap)
+ {
+ default: // com::sun::star::drawing::LineCap_BUTT:
+ {
+ aCGLineCap = kCGLineCapButt;
+ break;
+ }
+ case com::sun::star::drawing::LineCap_ROUND:
+ {
+ aCGLineCap = kCGLineCapRound;
+ break;
+ }
+ case com::sun::star::drawing::LineCap_SQUARE:
+ {
+ aCGLineCap = kCGLineCapSquare;
+ break;
+ }
+ }
+
// setup poly-polygon path
CGMutablePathRef xPath = CGPathCreateMutable();
AddPolygonToPath( xPath, rPolyLine, rPolyLine.isClosed(), !getAntiAliasB2DDraw(), true );
@@ -711,6 +734,7 @@ bool IosSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon& rPolyLine,
CGContextSetShouldAntialias( mrContext, true );
CGContextSetAlpha( mrContext, 1.0 - fTransparency );
CGContextSetLineJoin( mrContext, aCGLineJoin );
+ CGContextSetLineCap( mrContext, aCGLineCap );
CGContextSetLineWidth( mrContext, rLineWidths.getX() );
CGContextDrawPath( mrContext, kCGPathStroke );
CGContextRestoreGState( mrContext );