summaryrefslogtreecommitdiff
path: root/vcl/qt5/Qt5Graphics_GDI.cxx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2018-08-09 14:53:50 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2018-08-10 09:46:49 +0200
commit3e52c6512e8f00c7f1481a09b50c9c8d5ac1aca5 (patch)
tree9aa3a27e6401b87a7be1913bf0e2e0eba7712883 /vcl/qt5/Qt5Graphics_GDI.cxx
parent0927c5b3101064905028aeaff2c266771c6e09b3 (diff)
Qt5 fix nTransparency handling
So nTransparency is actually also in percent, i.e. max is 100, instead of the full byte range, like alpha colors in Qt and VCL. Fixes "SAL_USE_VCLPLUGIN=qt5 ./bin/run vcldemo --show poly" transparency. Change-Id: I723cbb2d6b5af4a37b18d3e6a5e0c5b81421221a Reviewed-on: https://gerrit.libreoffice.org/58789 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/qt5/Qt5Graphics_GDI.cxx')
-rw-r--r--vcl/qt5/Qt5Graphics_GDI.cxx13
1 files changed, 5 insertions, 8 deletions
diff --git a/vcl/qt5/Qt5Graphics_GDI.cxx b/vcl/qt5/Qt5Graphics_GDI.cxx
index 4b4ae0ea545f..1a61fe540e79 100644
--- a/vcl/qt5/Qt5Graphics_GDI.cxx
+++ b/vcl/qt5/Qt5Graphics_GDI.cxx
@@ -324,9 +324,6 @@ bool Qt5Graphics::drawPolyLine(const basegfx::B2DPolygon& rPolyLine, double fTra
if (SALCOLOR_NONE == m_aFillColor && SALCOLOR_NONE == m_aLineColor)
return true;
- if (basegfx::B2DLineJoin::NONE == eLineJoin)
- return false;
-
// short circuit if there is nothing to do
const int nPointCount = rPolyLine.count();
if (nPointCount <= 0)
@@ -344,15 +341,13 @@ bool Qt5Graphics::drawPolyLine(const basegfx::B2DPolygon& rPolyLine, double fTra
switch (eLineJoin)
{
- case basegfx::B2DLineJoin::NONE:
- std::abort();
- return false;
case basegfx::B2DLineJoin::Bevel:
aPen.setJoinStyle(Qt::BevelJoin);
break;
case basegfx::B2DLineJoin::Round:
aPen.setJoinStyle(Qt::RoundJoin);
break;
+ case basegfx::B2DLineJoin::NONE:
case basegfx::B2DLineJoin::Miter:
aPen.setMiterLimit(1.0 / sin(fMiterMinimumAngle / 2.0));
aPen.setJoinStyle(Qt::MiterJoin);
@@ -604,8 +599,10 @@ bool Qt5Graphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight,
{
if (SALCOLOR_NONE == m_aFillColor && SALCOLOR_NONE == m_aLineColor)
return true;
-
- Qt5Painter aPainter(*this, true, nTransparency);
+ assert(nTransparency <= 100);
+ if (nTransparency > 100)
+ nTransparency = 100;
+ Qt5Painter aPainter(*this, true, (100 - nTransparency) * (255.0 / 100));
if (SALCOLOR_NONE != m_aFillColor)
aPainter.fillRect(nX, nY, nWidth, nHeight, aPainter.brush());
if (SALCOLOR_NONE != m_aLineColor)