From 4c066a82962a9a0634dcfe0a305de7b2a4cacc5b Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Sat, 16 Jan 2016 20:55:45 +0100 Subject: Added the Colormap component. * The Colormap component is a simple rect with a texture mapped that displays a ColorScale with a fixed number of samples. This number of samples is exported as a member const, which is used on other components (such as VoronoiSplat). * The texture mapping is reflecting the colormap lookup used in VoronoiSplat. * The ColorScale class now has a method for sampling the color scale and outputs the samples to iterator-style objects, providing easy intergration with existing code. --- scatterplot.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scatterplot.cpp') diff --git a/scatterplot.cpp b/scatterplot.cpp index 04a50cd..5b7e82d 100644 --- a/scatterplot.cpp +++ b/scatterplot.cpp @@ -12,7 +12,6 @@ static const QColor SELECTION_COLOR(128, 128, 128, 96); static const float GLYPH_SIZE = 8.0f; static const float GLYPH_OUTLINE_WIDTH = 2.0f; -static const float PADDING = 10.0f; Scatterplot::Scatterplot(QQuickItem *parent) : QQuickItem(parent) @@ -239,7 +238,6 @@ QSGNode *Scatterplot::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) updateGlyphs(node); node = node->nextSibling(); - // Change update hints to false; the splat and glyphs were just updated if (m_shouldUpdateGeometry) { m_shouldUpdateGeometry = false; } @@ -265,6 +263,10 @@ void Scatterplot::updateGlyphs(QSGNode *glyphsNode) { qreal x, y, tx, ty, moveTranslationF; + if (!m_shouldUpdateGeometry && !m_shouldUpdateMaterials) { + return; + } + if (m_currentInteractionState == INTERACTION_MOVING) { tx = m_dragCurrentPos.x() - m_dragOriginPos.x(); ty = m_dragCurrentPos.y() - m_dragOriginPos.y(); -- cgit v1.2.3