Code

center the tree on the current layer
authoracspike <acspike@users.sourceforge.net>
Sun, 28 May 2006 03:50:26 +0000 (03:50 +0000)
committeracspike <acspike@users.sourceforge.net>
Sun, 28 May 2006 03:50:26 +0000 (03:50 +0000)
share/extensions/rtree.py

index a70b2b4c08086e640736fdeb90cdef34c6ab4001..5d8ac9f3d6372f55ac8ff8a43cb00ae042297432 100755 (executable)
@@ -51,9 +51,12 @@ class RTreeTurtle(inkex.Effect):
             'fill': 'none'}
         new.setAttribute('style', simplestyle.formatStyle(s))
         t = pturtle.pTurtle()
+        t.pu()
+        t.setpos(self.view_center)
+        t.pd()
         rtree(t, self.options.size, self.options.minimum)
         new.setAttribute('d', t.getPath())
-        self.document.documentElement.appendChild(new)
+        self.current_layer.appendChild(new)
 
 e = RTreeTurtle()
 e.affect()