New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show an error message when there is no selected object but a layer #33
Comments
Interesting. FYI, Inkscape 1.1.1 doesn't select the contents of a layer when the layer itself is selected; this is new in Inkscape 1.2-dev. You may be surprised to learn that it's in fact perfectly valid to apply transformations to a layer. A layer is just a group that Inkscape marks with an This should take just a few lines of code. Working on that now… |
Thank you for your reply. Now if a layer is selected nothing happens (this is better than a mysterious error message) and my point was to inform the user that he is selecting a layer instead and not its items because that's very unlikely that his/her intent is to apply the transformation on the layer itself (on the special group). and because However, there is a small issue regarding the
but:
|
I'm unable to reproduce either of the above with dcf1941. Here's a sample image in Inkscape 1.2-dev in which I selected the layer: I then ran the Simple Inkscape Scripting script. objs = svg_root.selection
for obj in objs:
obj = inkex_object(obj)
obj.rotate(50) This correctly rotated the layer around the origin: I then ran objs = svg_root.selection
for obj in objs:
obj = inkex_object(obj)
obj.rotate(50, 'center') and Inkscape correctly rotated the layer around its center: Do you observe different behavior from Simple Inkscape Scripting dcf1941? |
Hi Sorry I forget to mention in my last post that I am referring to an empty Layer without objects (as in my first screenshot, first post). I believe you could reproduce that error message by selecting an empty layer. (Unfortunately, the current behaviour of Inkscape 1.2 is a little bit strange, in order to select a layer you need to click two times (not double click), and I've read somewhere that they will revert that behaviour: a small demonstration that is not related to this issue is to try to remove a layer, when you click the remove button it's likely that nothing will happen even if the layer appears to be selected, you need to click again in oder to select it ). |
Ah, I had overlooked that fact. I can now reproduce your problem. Reopening the issue… |
Simple Inkscape Scripting should now be able to transform an empty layer. Please reopen the issue if you find a case in which that's still failing. |
I've tested the latest commit. It works perfctly. |
I am trying the recent API of SimpInkScr using Inkscape 1.2-dev:
The document is empty but I have selected the Layer 1 from "Object > Layer and objects" as shown below
But I am getting this confusing error message (I believe this could happen, if the layer is accidently selected intead of an object).
Is there an easy solution to get a meaninful error message to inform the user that the selection is a layer so it couldn't be transformed?
The text was updated successfully, but these errors were encountered: