Several 'Render' extensions use self.view_center to place new objects into the current layer (or group). None of them take parent transforms on layers (e.g. after a change of the page height/orientation or a resize of the page to drawing/selection) into account.
The proposed patch adds a new function to simpletransform.py, computePointInNode(), which can be used to convert self.view_center into coordinates which compensate any parent transforms of the current layer.
Changes to simpletransform.py
1) the function invertTransform() is copied from voronoi2svg.py (a later commit could remove the original version in voronoi2svg to avoid two copies).
2) a new function computePointInNode() which takes a point [x, y] and a XML node as arguments, is added. This function is called by all affected Render extensions.
TODO:
- Handle exception when current layer is document root.
Several 'Render' extensions use self.view_center to place new objects into the current layer (or group). None of them take parent transforms on layers (e.g. after a change of the page height/orientation or a resize of the page to drawing/selection) into account.
The proposed patch adds a new function to simpletransform.py, computePointInN ode(), which can be used to convert self.view_center into coordinates which compensate any parent transforms of the current layer.
Affected extensions (using self.view_center): barcode_ datamatrix. py barcode_ qrcode. py gear_rack. py sphere. py
grid_cartesian.py
grid_isometric.py
grid_polar.py
hershey.py
lindenmayer.py
polyhedron_3d.py
render_barcode.py
render_
render_
render_
render_gears.py
rtree.py
spirograph.py
triangle.py
whirl.py
wireframe_
Changes to simpletransform.py ode() which takes a point [x, y] and a XML node as arguments, is added. This function is called by all affected Render extensions.
1) the function invertTransform() is copied from voronoi2svg.py (a later commit could remove the original version in voronoi2svg to avoid two copies).
2) a new function computePointInN
TODO:
- Handle exception when current layer is document root.