mirror of https://github.com/qt/qtgraphs.git
Make opacity work in LineSeries and SplineSeries
Pick-to: 6.8 Fixes: QTBUG-137718 Change-Id: I15fe45c88faa596adb0f13faa91d36c24509ecd6 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io> (cherry picked from commitcc2154707b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit2bf7482691)
This commit is contained in:
parent
6ac732478f
commit
329f2d05e5
|
|
@ -127,13 +127,16 @@ PointRenderer::SeriesStyle PointRenderer::getSeriesStyle(PointGroup *group)
|
||||||
|
|
||||||
qsizetype index = group->colorIndex % seriesColors.size();
|
qsizetype index = group->colorIndex % seriesColors.size();
|
||||||
QColor color = group->series->color().alpha() != 0 ? group->series->color() : seriesColors.at(index);
|
QColor color = group->series->color().alpha() != 0 ? group->series->color() : seriesColors.at(index);
|
||||||
|
color.setAlpha(color.alpha() * group->series->opacity());
|
||||||
|
|
||||||
QColor selectedColor = group->series->selectedColor().alpha() != 0
|
QColor selectedColor = group->series->selectedColor().alpha() != 0
|
||||||
? group->series->selectedColor()
|
? group->series->selectedColor()
|
||||||
: m_graph->theme()->singleHighlightColor();
|
: m_graph->theme()->singleHighlightColor();
|
||||||
|
selectedColor.setAlpha(selectedColor.alpha() * group->series->opacity());
|
||||||
|
|
||||||
index = group->colorIndex % borderColors.size();
|
index = group->colorIndex % borderColors.size();
|
||||||
QColor borderColor = borderColors.at(index);
|
QColor borderColor = borderColors.at(index);
|
||||||
|
borderColor.setAlpha(borderColor.alpha() * group->series->opacity());
|
||||||
qreal borderWidth = theme->borderWidth();
|
qreal borderWidth = theme->borderWidth();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue