[glom] Print Layout: Make ruler markers follow moved items.



commit 6b50fffad8d34a85acffcf501ec1b044a50b831c
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Aug 9 17:41:23 2011 +0200

    Print Layout: Make ruler markers follow moved items.
    
    * glom/mode_design/print_layouts/window_print_layout_edit.cc:
    on_selected_item_moved(): Show the top-left position of the group of
    items, though maybe we should show just the moved item instead.
    Inkscape does not do this at all (it just shows the cursor position),
    so some other example would be nice.

 ChangeLog                                          |   10 ++++++++++
 .../print_layouts/window_print_layout_edit.cc      |   12 ++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 62911ce..c9226d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2011-08-09  Murray Cumming  <murrayc murrayc com>
 
+	Print Layout: Make ruler markers follow moved items.
+
+	* glom/mode_design/print_layouts/window_print_layout_edit.cc:
+	on_selected_item_moved(): Show the top-left position of the group of 
+	items, though maybe we should show just the moved item instead.
+	Inkscape does not do this at all (it just shows the cursor position),
+	so some other example would be nice.
+
+2011-08-09  Murray Cumming  <murrayc murrayc com>
+
 	Print Layout: Make ruler markers follow the cursor.
 
 	* glom/mode_design/print_layouts/window_print_layout_edit.[h|cc]:
diff --git a/glom/mode_design/print_layouts/window_print_layout_edit.cc b/glom/mode_design/print_layouts/window_print_layout_edit.cc
index b45dee9..bd6932e 100644
--- a/glom/mode_design/print_layouts/window_print_layout_edit.cc
+++ b/glom/mode_design/print_layouts/window_print_layout_edit.cc
@@ -1203,6 +1203,18 @@ void Window_PrintLayout_Edit::on_selected_item_moved(const Glib::RefPtr<CanvasIt
   
   //Show the new positions in the spinbuttons:
   on_canvas_selection_changed();
+
+  //Show the left-most and top-most position in the rulers:
+  //TODO: Maybe showing the position of the one item being 
+  //moved (though part of a group) would be better.
+  //Inkscape just tracks the cursor, which doesn't seem useful.
+  double x = 0;
+  double y = 0;
+  double width = 0;
+  double height = 0;
+  get_dimensions_of_multiple_selected_items(x, y, width, height);
+  gimp_ruler_set_position(m_hruler, x);
+  gimp_ruler_set_position(m_vruler, y);
 }
 
 void Window_PrintLayout_Edit::on_spinbutton_x()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]