summaryrefslogtreecommitdiff
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
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>
-rw-r--r--vcl/qt5/Qt5Graphics.cxx1
-rw-r--r--vcl/qt5/Qt5Graphics_GDI.cxx13
-rw-r--r--vcl/qt5/Qt5Painter.cxx1
3 files changed, 6 insertions, 9 deletions
diff --git a/vcl/qt5/Qt5Graphics.cxx b/vcl/qt5/Qt5Graphics.cxx
index 329d261c6097..fbf7ae05bf6b 100644
--- a/vcl/qt5/Qt5Graphics.cxx
+++ b/vcl/qt5/Qt5Graphics.cxx
@@ -121,6 +121,7 @@ bool Qt5Graphics::drawNativeControl(ControlType nType, ControlPart nPart,
Qt5Painter aPainter(*this);
aPainter.drawImage(QPoint(rControlRegion.getX(), rControlRegion.getY()),
m_aControl.getImage());
+ aPainter.update(toQRect(rControlRegion));
}
return bHandled;
}
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)
diff --git a/vcl/qt5/Qt5Painter.cxx b/vcl/qt5/Qt5Painter.cxx
index 7fa5c40f7e87..06eeb2895214 100644
--- a/vcl/qt5/Qt5Painter.cxx
+++ b/vcl/qt5/Qt5Painter.cxx
@@ -47,7 +47,6 @@ Qt5Painter::Qt5Painter(Qt5Graphics& rGraphics, bool bPrepareBrush, sal_uInt8 nTr
{
QColor aColor = toQColor(rGraphics.m_aFillColor);
aColor.setAlpha(nTransparency);
- setBrush(Qt::SolidPattern);
setBrush(aColor);
}
setCompositionMode(rGraphics.m_eCompositionMode);