summaryrefslogtreecommitdiff
path: root/vcl/source/outdev
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-11-10 16:08:17 +0100
committerLuboš Luňák <l.lunak@collabora.com>2020-11-11 11:42:59 +0100
commit1fde62018c8d3344a3408c7b6317120aefc778fb (patch)
treed3e50b3c4e665b4ed98b19ca0cc4ed0c78c3c4f6 /vcl/source/outdev
parentbf4379690ad7721ed62c488c7750ad6c214cd63d (diff)
make sure mpAlphaVDev is drawn when drawing lines (tdf#137974)
4deadc3c78949c18bb886eb1f66caa8f3cd7a2df made OutputDevice::DrawLine() use SalGraphics::DrawPolyLine() in more cases, which revealed that the the function was bailing out after the call and not drawing also to mpAlphaVDev. Change-Id: I1145d3684835b536737311294edfc566d5eb9025 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105553 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl/source/outdev')
-rw-r--r--vcl/source/outdev/line.cxx20
-rw-r--r--vcl/source/outdev/polyline.cxx38
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 )