Kaydet (Commit) f354ba7a authored tarafından Tor Lillqvist's avatar Tor Lillqvist

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
üst b9c98414
......@@ -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,
......
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment