diff options
author | Samuel Fadel <samuelfadel@gmail.com> | 2015-09-15 13:28:10 -0300 |
---|---|---|
committer | Samuel Fadel <samuelfadel@gmail.com> | 2015-09-15 13:28:10 -0300 |
commit | 8b1e2720b1253a91e3b75a08e2f5a38deb55affa (patch) | |
tree | 5627eff9b10b7ef06774a3045864ddfa436dbc50 | |
parent | f0cccff515cd9e94990a3de95a8a2a235bc6d7a8 (diff) |
Removed color scale initialization in Scatterplot and changed the signaling to happen only on mouse release.
-rw-r--r-- | scatterplot.cpp | 18 |
1 files changed, 2 insertions, 16 deletions
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); } |