summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-12-15 11:55:29 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-12-15 20:37:29 +0100
commit9902a53ee9c6d74fef6ab0ae9f602cf7895fecfd (patch)
tree9c336af78e19c6725dba9e2f0e3078e362a4d472 /vcl
parentf012855cb6d845e8efcb6292d55542bd06273875 (diff)
tdf#138936 gradient missing under RTL from writer comment margins
Change-Id: I57533f033f9528b7c89162967b392eb5abb4d76a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107750 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/salgdi.hxx3
-rw-r--r--vcl/source/gdi/salgdilayout.cxx8
-rw-r--r--vcl/source/outdev/gradient.cxx2
3 files changed, 10 insertions, 3 deletions
diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx
index d43e3b632d45..ce31d808e98b 100644
--- a/vcl/inc/salgdi.hxx
+++ b/vcl/inc/salgdi.hxx
@@ -271,7 +271,8 @@ public:
bool DrawGradient(
const tools::PolyPolygon& rPolyPoly,
- const Gradient& rGradient );
+ const Gradient& rGradient,
+ const OutputDevice& rOutDev);
bool DrawGradient(basegfx::B2DPolyPolygon const & rPolyPolygon,
SalGradient const & rGradient);
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index e5fe48e851ab..59ec974c2dd3 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -553,8 +553,14 @@ bool SalGraphics::DrawPolyLine(
bPixelSnapHairline);
}
-bool SalGraphics::DrawGradient( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient )
+bool SalGraphics::DrawGradient(const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient, const OutputDevice& rOutDev)
{
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
+ {
+ tools::PolyPolygon aFinal(mirror(rPolyPoly.getB2DPolyPolygon(), rOutDev));
+ return drawGradient(aFinal, rGradient);
+ }
+
return drawGradient( rPolyPoly, rGradient );
}
diff --git a/vcl/source/outdev/gradient.cxx b/vcl/source/outdev/gradient.cxx
index f37bad807845..ea8e8b1ca703 100644
--- a/vcl/source/outdev/gradient.cxx
+++ b/vcl/source/outdev/gradient.cxx
@@ -107,7 +107,7 @@ void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly,
// try to draw gradient natively
if (!mbOutputClipped)
- bDrawn = mpGraphics->DrawGradient( aClixPolyPoly, aGradient );
+ bDrawn = mpGraphics->DrawGradient( aClixPolyPoly, aGradient, *this );
if (!bDrawn && !mbOutputClipped)
{