diff view/Pane.cpp @ 635:5c9dcec5f3e9 tonioni

splitting notes works but major cleanup needed
author gyorgyf
date Sat, 20 Apr 2013 08:38:37 +0100
parents 5b72899d692b
children c8f45afb83d5
line wrap: on
line diff
--- a/view/Pane.cpp	Fri Apr 19 15:37:27 2013 +0100
+++ b/view/Pane.cpp	Sat Apr 20 08:38:37 2013 +0100
@@ -1278,7 +1278,7 @@
         return;
     }
 
-//    std::cerr << "mousePressEvent" << std::endl;
+   // std::cerr << "mousePressEvent" << std::endl;
 
     m_clickPos = e->pos();
     m_mousePos = m_clickPos;
@@ -1378,6 +1378,12 @@
 
     } else if (mode == ViewManager::EditMode) {
 
+        std::cerr << "mouse pressed in edit mode" << std::endl;
+        Layer *layer = getSelectedLayer();
+        if (layer && layer->isLayerEditable()) {
+            layer->splitStart(this, e); 
+        }
+
         // Do nothing here -- we'll do it in mouseMoveEvent when the
         // drag threshold has been passed
 
@@ -1473,6 +1479,12 @@
 	}
 
     } else if (mode == ViewManager::EditMode) {
+	
+		//GF: temporary
+        Layer *layer = getSelectedLayer();
+        if (layer && layer->isLayerEditable()) {
+            layer->splitEnd(this, e);
+            update(); }
 
         if (m_editing) {
             if (!editSelectionEnd(e)) {
@@ -1482,7 +1494,7 @@
                     update();
                 }
             }
-        }
+        } 
 
     } else if (mode == ViewManager::MeasureMode) {
 
@@ -1615,7 +1627,7 @@
             // dragging to be used most of the time
         }
 
-        if (m_shiftPressed) resist = false;
+		if (m_shiftPressed) resist = false;
 
         m_dragMode = updateDragMode
             (m_dragMode,