inkscape-guide-tools
inkscape-guide-tools copied to clipboard
Moved units for selected object to correct base units and added selection of objects
As others have done PRs for unittouu class references, this includes these otherwise the extension fails to run on recent versions of Inkscape.
This PR resolves guides not being added in the correct place for selected objects when using 'Add Centered Guides to Page or Selection' or 'Add Margin Guides to Page or Selection'.
The material change is a single line, from:
q[query] = p.stdout.read()
to
q[query] = self.unittouu(p.stdout.read() + 'px')
Although it took me some time to figure that out! :-) This ensures that the units used for the calculation use the same base. At least, without deeper inspection this appears to work.
I've updated to allow for selection of multiple objects and then adding either margin or centered guides. I've re-written the subprocess calls to reduce the number of calls and speed up the process by querying all objects and then parsing them.
I've also updated the documentation.
I'd welcome any comments.
I guess this is dead by now.