--- dia-0.97-orig/plug-ins/svg/render_svg.c	2009-04-17 01:25:24.000000000 -0700
+++ dia-0.97/plug-ins/svg/render_svg.c	2010-02-11 13:46:42.000000000 -0800
@@ -213,6 +213,8 @@
   /* apparently most svg readers don't like small values, especially not in the viewBox attribute */
   renderer->scale = 20.0;
 
+  message_warning("scaling = %f\n", data->paper.scaling);
+
   /* set up the root node */
   renderer->doc = xmlNewDoc((const xmlChar *)"1.0");
   renderer->doc->encoding = xmlStrdup((const xmlChar *)"UTF-8");
@@ -229,11 +231,11 @@
 
   /* set the extents of the SVG document */
   extent = &data->extents;
-  g_snprintf(buf, sizeof(buf), "%dcm",
-	     (int)ceil((extent->right - extent->left)));
+  g_snprintf(buf, sizeof(buf), "%.4fcm",
+             (extent->right - extent->left) * data->paper.scaling);
   xmlSetProp(renderer->root, (const xmlChar *)"width", (xmlChar *) buf);
-  g_snprintf(buf, sizeof(buf), "%dcm",
-	     (int)ceil((extent->bottom - extent->top)));
+  g_snprintf(buf, sizeof(buf), "%.4fcm",
+	     (extent->bottom - extent->top) * data->paper.scaling);
   xmlSetProp(renderer->root, (const xmlChar *)"height", (xmlChar *) buf);
   g_snprintf(buf, sizeof(buf), "%d %d %d %d",
 	     (int)floor(extent->left  * renderer->scale), (int)floor(extent->top * renderer->scale),
