diff options
author | Samuel Fadel <samuelfadel@gmail.com> | 2016-01-28 11:50:52 +0100 |
---|---|---|
committer | Samuel Fadel <samuelfadel@gmail.com> | 2016-01-28 11:50:52 +0100 |
commit | 5404374a510b4c09bd4d38331a1255583abb28d4 (patch) | |
tree | 8208362874c981c6222895f8172396b4a4b320d7 | |
parent | 025b2fac13177bc9182df16ae7324e515720885e (diff) |
Scatterplot: set default glyph color (white) when no color is available.
-rw-r--r-- | scatterplot.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scatterplot.cpp b/scatterplot.cpp index 7666f28..260825c 100644 --- a/scatterplot.cpp +++ b/scatterplot.cpp @@ -10,6 +10,7 @@ #include "geometry.h" // Glyphs settings +static const QColor DEFAULT_GLYPH_COLOR(255, 255, 255); static const float DEFAULT_GLYPH_SIZE = 8.0f; static const qreal GLYPH_OPACITY = 1.0; static const qreal GLYPH_OPACITY_SELECTED = 1.0; @@ -445,7 +446,7 @@ QSGNode *Scatterplot::newGlyphTree() glyphNode->setFlag(QSGNode::OwnsGeometry); material = new QSGFlatColorMaterial; - material->setColor(QColor()); + material->setColor(DEFAULT_GLYPH_COLOR); glyphNode->setMaterial(material); glyphNode->setFlag(QSGNode::OwnsMaterial); @@ -548,7 +549,7 @@ void Scatterplot::updateGlyphs(QSGNode *glyphsNode) if (m_colorData.n_elem > 0) { material->setColor(m_colorScale.color(m_colorData[i])); } else { - material->setColor(QColor()); + material->setColor(DEFAULT_GLYPH_COLOR); } glyphNode->markDirty(QSGNode::DirtyMaterial); } |