Code

patch for bug 1458643 by Andreas Burman
authorbuliabyak <buliabyak@users.sourceforge.net>
Sun, 14 May 2006 02:52:57 +0000 (02:52 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Sun, 14 May 2006 02:52:57 +0000 (02:52 +0000)
src/sp-use.cpp

index 52f8f11e46116ef66a180302436d31033f6f7d47..31bee3717745eb841a3de4d6f4f906528e320957 100644 (file)
@@ -26,6 +26,7 @@
 #include "sp-object-repr.h"
 #include "sp-flowregion.h"
 #include "uri.h"
+#include "print.h"
 #include "xml/repr.h"
 #include "prefs-utils.h"
 #include "style.h"
@@ -279,11 +280,23 @@ sp_use_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &transform, unsig
 static void
 sp_use_print(SPItem *item, SPPrintContext *ctx)
 {
+    bool translated = false;
+    NRMatrix tp;
     SPUse *use = SP_USE(item);
 
+    if ((use->x._set && use->x.computed != 0) || (use->y._set && use->y.computed != 0)) {
+        nr_matrix_set_translate(&tp, use->x.computed, use->y.computed);
+        sp_print_bind(ctx, &tp, 1.0);
+        translated = true;
+    }
+
     if (use->child && SP_IS_ITEM(use->child)) {
         sp_item_invoke_print(SP_ITEM(use->child), ctx);
     }
+
+    if (translated) {
+        sp_print_release(ctx);
+    }
 }
 
 static gchar *