vcl canvas, don't draw bezier curves as straight lines (tdf#133905)
Change-Id: I8a5029ef7aa6e8f46b13f0713445da435b47dbed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96209 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
This commit is contained in:
parent
05d914f01f
commit
5d8f2c1eda
1 changed files with 8 additions and 21 deletions
|
@ -394,8 +394,6 @@ namespace vclcanvas
|
||||||
// user coordinates.
|
// user coordinates.
|
||||||
aStrokedPolyPoly.transform( aMatrix );
|
aStrokedPolyPoly.transform( aMatrix );
|
||||||
|
|
||||||
const ::tools::PolyPolygon aVCLPolyPoly( aStrokedPolyPoly );
|
|
||||||
|
|
||||||
// TODO(F2): When using alpha here, must handle that via
|
// TODO(F2): When using alpha here, must handle that via
|
||||||
// temporary surface or somesuch.
|
// temporary surface or somesuch.
|
||||||
|
|
||||||
|
@ -403,28 +401,17 @@ namespace vclcanvas
|
||||||
// self-intersections. Therefore, if we would render it
|
// self-intersections. Therefore, if we would render it
|
||||||
// via OutDev::DrawPolyPolygon(), on/off fill would
|
// via OutDev::DrawPolyPolygon(), on/off fill would
|
||||||
// generate off areas on those self-intersections.
|
// generate off areas on those self-intersections.
|
||||||
sal_uInt16 nSize( aVCLPolyPoly.Count() );
|
for( sal_uInt32 i=0; i<aStrokedPolyPoly.count(); ++i )
|
||||||
|
|
||||||
for( sal_uInt16 i=0; i<nSize; ++i )
|
|
||||||
{
|
{
|
||||||
if( aStrokedPolyPoly.getB2DPolygon( i ).isClosed() ) {
|
const basegfx::B2DPolygon& polygon = aStrokedPolyPoly.getB2DPolygon( i );
|
||||||
mpOutDevProvider->getOutDev().DrawPolygon( aVCLPolyPoly[i] );
|
if( polygon.isClosed()) {
|
||||||
|
mpOutDevProvider->getOutDev().DrawPolygon( polygon );
|
||||||
if( mp2ndOutDevProvider )
|
if( mp2ndOutDevProvider )
|
||||||
mp2ndOutDevProvider->getOutDev().DrawPolygon( aVCLPolyPoly[i] );
|
mp2ndOutDevProvider->getOutDev().DrawPolygon( polygon );
|
||||||
} else {
|
} else {
|
||||||
const sal_uInt16 nPolySize = aVCLPolyPoly[i].GetSize();
|
mpOutDevProvider->getOutDev().DrawPolyLine( polygon );
|
||||||
if( nPolySize ) {
|
if( mp2ndOutDevProvider )
|
||||||
Point rPrevPoint = aVCLPolyPoly[i].GetPoint( 0 );
|
mp2ndOutDevProvider->getOutDev().DrawPolyLine( polygon );
|
||||||
Point rPoint;
|
|
||||||
|
|
||||||
for( sal_uInt16 j=1; j<nPolySize; j++ ) {
|
|
||||||
rPoint = aVCLPolyPoly[i].GetPoint( j );
|
|
||||||
mpOutDevProvider->getOutDev().DrawLine( rPrevPoint, rPoint );
|
|
||||||
if( mp2ndOutDevProvider )
|
|
||||||
mp2ndOutDevProvider->getOutDev().DrawLine( rPrevPoint, rPoint );
|
|
||||||
rPrevPoint = rPoint;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue