[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [marble] src/plugins/render/annotate: Check if there is any node highlighted at state changed too, s
From:       Cruceru Calin-Cristian <crucerucalincristian () gmail ! com>
Date:       2014-07-31 21:47:05
Message-ID: E1XCyBl-0004Ha-Ro () scm ! kde ! org
[Download RAW message or body]

Git commit c4f636e8c1f66a0d00ee77644d0b8a86bf64a6d3 by Cruceru Calin-Cristian.
Committed on 31/07/2014 at 21:45.
Pushed by crucerucalincristian into branch 'master'.

Check if there is any node highlighted at state changed too, since the
map may not catch mouse move events if the mouse is moved too fast.

M  +25   -1    src/plugins/render/annotate/AreaAnnotation.cpp

http://commits.kde.org/marble/c4f636e8c1f66a0d00ee77644d0b8a86bf64a6d3

diff --git a/src/plugins/render/annotate/AreaAnnotation.cpp \
b/src/plugins/render/annotate/AreaAnnotation.cpp index 4ba7a74..71140df 100644
--- a/src/plugins/render/annotate/AreaAnnotation.cpp
+++ b/src/plugins/render/annotate/AreaAnnotation.cpp
@@ -202,7 +202,7 @@ void AreaAnnotation::dealWithItemChange( const SceneGraphicsItem \
*other )  {
     Q_UNUSED( other );
 
-    // So far we only deal with item changes when hovering virtual nodes, so that
+    // So far we only deal with item changes when hovering nodes, so that
     // they do not remain hovered when changing the item we interact with.
     if ( state() == SceneGraphicsItem::Editing ) {
         if ( m_hoveredNode != QPair<int, int>( -1, -1 ) ) {
@@ -487,6 +487,18 @@ void AreaAnnotation::dealWithStateChange( \
SceneGraphicsItem::ActionState previou  {
     // Dealing with cases when exiting a state has an effect on this item.
     if ( previousState == SceneGraphicsItem::Editing ) {
+        // Make sure that when changing the state, there is no highlighted node.
+        if ( m_hoveredNode != QPair<int, int>( -1, -1 ) ) {
+            int i = m_hoveredNode.first;
+            int j = m_hoveredNode.second;
+
+            if ( j == -1 ) {
+                m_outerNodesList[i].setFlag( PolygonNode::NodeIsEditingHighlighted, \
false ); +            } else {
+                m_innerNodesList[i][j].setFlag( \
PolygonNode::NodeIsEditingHighlighted, false ); +            }
+        }
+
         m_clickedNodeIndexes = QPair<int, int>( -1, -1 );
         m_hoveredNode = QPair<int, int>( -1, -1 );
     } else if ( previousState == SceneGraphicsItem::AddingPolygonHole ) {
@@ -520,6 +532,18 @@ void AreaAnnotation::dealWithStateChange( \
                SceneGraphicsItem::ActionState previou
             m_outerNodesList[i].setFlag( PolygonNode::NodeIsMerged, false );
         }
 
+        // Make sure that when changing the state, there is no highlighted node.
+        if ( m_hoveredNode != QPair<int, int>( -1, -1 ) ) {
+            int i = m_hoveredNode.first;
+            int j = m_hoveredNode.second;
+
+            if ( j == -1 ) {
+                m_outerNodesList[i].setFlag( PolygonNode::NodeIsMergingHighlighted, \
false ); +            } else {
+                m_innerNodesList[i][j].setFlag( \
PolygonNode::NodeIsMergingHighlighted, false ); +            }
+        }
+
         m_firstMergedNode = QPair<int, int>( -1, -1 );
         m_hoveredNode = QPair<int, int>( -1, -1 );
         delete m_animation;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic