diff options
-rw-r--r-- | vcl/source/outdev/line.cxx | 20 | ||||
-rw-r--r-- | vcl/source/outdev/polyline.cxx | 38 |
2 files changed, 29 insertions, 29 deletions
diff --git a/vcl/source/outdev/line.cxx b/vcl/source/outdev/line.cxx index f965f0fdd1fc..a715c25521ae 100644 --- a/vcl/source/outdev/line.cxx +++ b/vcl/source/outdev/line.cxx @@ -107,6 +107,8 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt ) if ( mbInitLineColor ) InitLineColor(); + bool bDrawn = false; + // #i101598# support AA and snap for lines, too if( mpGraphics->supportsOperation(OutDevSupportType::B2DDraw) && RasterOp::OverPaint == GetRasterOp() @@ -123,7 +125,7 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt ) const bool bPixelSnapHairline(mnAntialiasing & AntialiasingFlags::PixelSnapHairline); - if( mpGraphics->DrawPolyLine( + bDrawn = mpGraphics->DrawPolyLine( basegfx::B2DHomMatrix(), aB2DPolyLine, 0.0, @@ -133,16 +135,14 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt ) css::drawing::LineCap_BUTT, basegfx::deg2rad(15.0), // not used with B2DLineJoin::NONE, but the correct default bPixelSnapHairline, - this)) - { - return; - } + this); + } + if(!bDrawn) + { + const Point aStartPt(ImplLogicToDevicePixel(rStartPt)); + const Point aEndPt(ImplLogicToDevicePixel(rEndPt)); + mpGraphics->DrawLine( aStartPt.X(), aStartPt.Y(), aEndPt.X(), aEndPt.Y(), this ); } - - const Point aStartPt(ImplLogicToDevicePixel(rStartPt)); - const Point aEndPt(ImplLogicToDevicePixel(rEndPt)); - - mpGraphics->DrawLine( aStartPt.X(), aStartPt.Y(), aEndPt.X(), aEndPt.Y(), this ); if( mpAlphaVDev ) mpAlphaVDev->DrawLine( rStartPt, rEndPt ); diff --git a/vcl/source/outdev/polyline.cxx b/vcl/source/outdev/polyline.cxx index d0900c10da33..a1bd0df6f82e 100644 --- a/vcl/source/outdev/polyline.cxx +++ b/vcl/source/outdev/polyline.cxx @@ -67,7 +67,7 @@ void OutputDevice::DrawPolyLine( const tools::Polygon& rPoly ) const basegfx::B2DHomMatrix aTransform(ImplGetDeviceTransformation()); const bool bPixelSnapHairline(mnAntialiasing & AntialiasingFlags::PixelSnapHairline); - if(mpGraphics->DrawPolyLine( + bool bDrawn = mpGraphics->DrawPolyLine( aTransform, aB2DPolyLine, 0.0, @@ -77,28 +77,28 @@ void OutputDevice::DrawPolyLine( const tools::Polygon& rPoly ) css::drawing::LineCap_BUTT, basegfx::deg2rad(15.0) /*default fMiterMinimumAngle, not used*/, bPixelSnapHairline, - this)) - { - return; - } + this); - tools::Polygon aPoly = ImplLogicToDevicePixel( rPoly ); - SalPoint* pPtAry = reinterpret_cast<SalPoint*>(aPoly.GetPointAry()); - - // #100127# Forward beziers to sal, if any - if( aPoly.HasFlags() ) + if(!bDrawn) { - const PolyFlags* pFlgAry = aPoly.GetConstFlagAry(); - if( !mpGraphics->DrawPolyLineBezier( nPoints, pPtAry, pFlgAry, this ) ) + tools::Polygon aPoly = ImplLogicToDevicePixel( rPoly ); + SalPoint* pPtAry = reinterpret_cast<SalPoint*>(aPoly.GetPointAry()); + + // #100127# Forward beziers to sal, if any + if( aPoly.HasFlags() ) { - aPoly = tools::Polygon::SubdivideBezier(aPoly); - pPtAry = reinterpret_cast<SalPoint*>(aPoly.GetPointAry()); - mpGraphics->DrawPolyLine( aPoly.GetSize(), pPtAry, this ); + const PolyFlags* pFlgAry = aPoly.GetConstFlagAry(); + if( !mpGraphics->DrawPolyLineBezier( nPoints, pPtAry, pFlgAry, this ) ) + { + aPoly = tools::Polygon::SubdivideBezier(aPoly); + pPtAry = reinterpret_cast<SalPoint*>(aPoly.GetPointAry()); + mpGraphics->DrawPolyLine( aPoly.GetSize(), pPtAry, this ); + } + } + else + { + mpGraphics->DrawPolyLine( nPoints, pPtAry, this ); } - } - else - { - mpGraphics->DrawPolyLine( nPoints, pPtAry, this ); } if( mpAlphaVDev ) |