aboutsummaryrefslogtreecommitdiff
path: root/scatterplot.cpp
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2015-08-27 15:22:29 -0300
committerSamuel Fadel <samuelfadel@gmail.com>2015-08-27 15:22:29 -0300
commit04e48cd798a28ad8df3233fa46b185d02d2d3f96 (patch)
tree7f5152883619d781f79f93ae936183b0012ede7e /scatterplot.cpp
parent09ba6872c6cfac49142a5c4b6d494c5c9d40aa4e (diff)
Renamed member m_currentState and reordered to match declaration and initialization.
Diffstat (limited to 'scatterplot.cpp')
-rw-r--r--scatterplot.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/scatterplot.cpp b/scatterplot.cpp
index 964642c..a121304 100644
--- a/scatterplot.cpp
+++ b/scatterplot.cpp
@@ -11,9 +11,9 @@ static const float PI = 3.1415f;
Scatterplot::Scatterplot(QQuickItem *parent)
: QQuickItem(parent)
+ , m_currentInteractionState(INTERACTION_NONE)
, m_shouldUpdateGeometry(false)
, m_shouldUpdateMaterials(false)
- , m_currentState(INTERACTION_NONE)
, m_colorScale{
QColor("#1f77b4"),
QColor("#ff7f0e"),
@@ -157,7 +157,7 @@ QSGNode *Scatterplot::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
} else
root = oldNode;
- if (m_currentState == INTERACTION_MOVING) {
+ if (m_currentInteractionState == INTERACTION_MOVING) {
tx = m_dragCurrentPos.x() - m_dragOriginPos.x();
ty = m_dragCurrentPos.y() - m_dragOriginPos.y();
} else
@@ -196,7 +196,7 @@ QSGNode *Scatterplot::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
m_shouldUpdateMaterials = false;
// Draw selection
- if (m_currentState == INTERACTION_SELECTING) {
+ if (m_currentInteractionState == INTERACTION_SELECTING) {
QSGSimpleRectNode *selectionNode = 0;
if (!root->firstChild()->nextSibling()) {
selectionNode = new QSGSimpleRectNode;
@@ -220,10 +220,10 @@ QSGNode *Scatterplot::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
void Scatterplot::mousePressEvent(QMouseEvent *event)
{
- switch (m_currentState) {
+ switch (m_currentInteractionState) {
case INTERACTION_NONE:
case INTERACTION_SELECTED:
- m_currentState = (event->button() == Qt::MiddleButton) ? INTERACTION_MOVING
+ m_currentInteractionState = (event->button() == Qt::MiddleButton) ? INTERACTION_MOVING
: INTERACTION_SELECTING;
m_dragOriginPos = event->localPos();
m_dragCurrentPos = m_dragOriginPos;
@@ -237,7 +237,7 @@ void Scatterplot::mousePressEvent(QMouseEvent *event)
void Scatterplot::mouseMoveEvent(QMouseEvent *event)
{
- switch (m_currentState) {
+ switch (m_currentInteractionState) {
case INTERACTION_SELECTING:
m_dragCurrentPos = event->localPos();
update();
@@ -259,16 +259,16 @@ void Scatterplot::mouseReleaseEvent(QMouseEvent *event)
{
bool mergeSelection;
- switch (m_currentState) {
+ switch (m_currentInteractionState) {
case INTERACTION_SELECTING:
mergeSelection = (event->button() == Qt::RightButton);
- m_currentState = selectGlyphs(mergeSelection) ? INTERACTION_SELECTED
+ m_currentInteractionState = selectGlyphs(mergeSelection) ? INTERACTION_SELECTED
: INTERACTION_NONE;
update();
break;
case INTERACTION_MOVING:
- m_currentState = INTERACTION_SELECTED;
+ m_currentInteractionState = INTERACTION_SELECTED;
updateGeometry();
break;
case INTERACTION_NONE: