From 8b1e2720b1253a91e3b75a08e2f5a38deb55affa Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Tue, 15 Sep 2015 13:28:10 -0300 Subject: Removed color scale initialization in Scatterplot and changed the signaling to happen only on mouse release. --- scatterplot.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'scatterplot.cpp') diff --git a/scatterplot.cpp b/scatterplot.cpp index 53981b4..36f6a38 100644 --- a/scatterplot.cpp +++ b/scatterplot.cpp @@ -19,18 +19,6 @@ Scatterplot::Scatterplot(QQuickItem *parent) , m_shouldUpdateGeometry(false) , m_shouldUpdateMaterials(false) { - m_colorScale = new ColorScale{ - QColor("#1f77b4"), - QColor("#ff7f0e"), - QColor("#2ca02c"), - QColor("#d62728"), - QColor("#9467bd"), - QColor("#8c564b"), - QColor("#e377c2"), - QColor("#17becf"), - QColor("#7f7f7f"), - }; - setClip(true); setFlag(QQuickItem::ItemHasContents); } @@ -308,6 +296,7 @@ void Scatterplot::mouseReleaseEvent(QMouseEvent *event) case INTERACTION_MOVING: m_currentInteractionState = INTERACTION_SELECTED; updateGeometry(); + emit xyChanged(m_xy); break; case INTERACTION_NONE: case INTERACTION_SELECTED: @@ -331,8 +320,7 @@ bool Scatterplot::selectGlyphs(bool mergeSelection) if (selectionRect.contains(x, y)) { m_selectedGlyphs.insert(i); - if (!anySelected) - anySelected = true; + anySelected = true; } } @@ -356,6 +344,4 @@ void Scatterplot::applyManipulation() row[1] = ((row[1] - m_ymin) / y_extent + ty) * y_extent + m_ymin; m_xy.row(*it) = row; } - - emit xyChanged(m_xy); } -- cgit v1.2.3