diff --git a/app/display.c b/app/display.c
index c9e27e5..4e391f1 100644
--- a/app/display.c
+++ b/app/display.c
@@ -47,6 +47,7 @@
 #include "render_gdk.h"
 #include "diatransform.h"
 #include "recent_files.h"
+#include "prefs.h"
 
 static GHashTable *display_ht = NULL;
 static GdkCursor *current_cursor = NULL;
@@ -727,6 +728,8 @@ ddisplay_set_origo(DDisplay *ddisp, coord x, coord y)
   Rectangle *extents = &ddisp->diagram->data->extents;
   Rectangle *visible = &ddisp->visible;
   int width, height;
+  GtkMetricType metric; 
+  real factor;
 
   /*  updaterar origo+visible+rulers */
   ddisp->origo.x = x;
@@ -746,16 +749,33 @@ ddisplay_set_origo(DDisplay *ddisp, coord x, coord y)
   visible->right = ddisp->origo.x + ddisplay_untransform_length(ddisp, width);
   visible->bottom = ddisp->origo.y + ddisplay_untransform_length(ddisp, height);
 
+  switch (prefs_get_length_unit()) {
+  case DIA_UNIT_CENTIMETER :
+    metric = GTK_CENTIMETERS;
+    factor = 28.35;
+    break;
+  case DIA_UNIT_INCH :
+    metric = GTK_INCHES;
+    factor = 28.35;
+    break;
+  default :
+    metric = GTK_PIXELS;
+    factor = 1;
+    break;
+  }
+  gtk_ruler_set_metric (GTK_RULER (ddisp->hrule), metric);
+  gtk_ruler_set_metric (GTK_RULER (ddisp->vrule), metric);
+
   gtk_ruler_set_range  (GTK_RULER (ddisp->hrule),
-			visible->left,
-			visible->right,
+			visible->left * factor,
+			visible->right * factor,
 			0.0f /* position*/,
-			MAX(extents->right, visible->right)/* max_size*/);
+			MAX(extents->right, visible->right) * factor);
   gtk_ruler_set_range  (GTK_RULER (ddisp->vrule),
-			visible->top,
-			visible->bottom,
+			visible->top * factor,
+			visible->bottom * factor,
 			0.0f /*        position*/,
-			MAX(extents->bottom, visible->bottom)/* max_size*/);
+			MAX(extents->bottom, visible->bottom) * factor);
 }
 
 void
