spakin / SimpInkScr

Simple Inkscape Scripting
https://inkscape.org/~pakin/%E2%98%85simple-inkscape-scripting
GNU General Public License v3.0
320 stars 31 forks source link

Guide id and locked properties are not preserved #122

Closed user202729 closed 8 months ago

user202729 commented 8 months ago

Problem

Do the following:

However,

The problem is that, even though print(1) does not change anything of the canvas, Inkscape register it as a change.

This is because the method

    @classmethod
    def _from_inkex_object(self, iobj):
        '''Create a Simple Inkscape Scripting SimpleGuide from an inkex
        Guide object.'''

does not store the original iobj, rather, it creates a new object with a new id, so that Inkscape thinks that something changed.

spakin commented 8 months ago

Thanks for the bug report and for tracking down the source of the problem. In a moment I'll upload a version of the code that uses the original iobj instead of creating a new one.