Code

scroll desktop to selected node after Tab/Shift-Tab
authorbuliabyak <buliabyak@users.sourceforge.net>
Fri, 12 Oct 2007 05:38:02 +0000 (05:38 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Fri, 12 Oct 2007 05:38:02 +0000 (05:38 +0000)
src/shape-editor.cpp

index d9a500e3c463cb2dd03a70c56cd181077010fec8..f029aab0a63b1d6acc21f975ed69ba5218c2841d 100644 (file)
@@ -442,12 +442,20 @@ void ShapeEditor::select_all_from_subpath (bool invert) {
         sp_nodepath_select_all_from_subpath (this->nodepath, invert);
 }
 void ShapeEditor::select_next () {
-    if (this->nodepath) 
+    if (this->nodepath) {
         sp_nodepath_select_next (this->nodepath);
+        if (this->nodepath->numSelected() >= 1) {
+            this->desktop->scroll_to_point(&(this->nodepath->singleSelectedCoords()), 1.0);
+        }
+    }
 }
 void ShapeEditor::select_prev () {
-    if (this->nodepath) 
+    if (this->nodepath) {
         sp_nodepath_select_prev (this->nodepath);
+        if (this->nodepath->numSelected() >= 1) {
+            this->desktop->scroll_to_point(&(this->nodepath->singleSelectedCoords()), 1.0);
+        }
+    }
 }
 
 void ShapeEditor::show_handles (bool show) {