Hi, I don't know if it is a bug or not, but I'm trying to get top left x and y layer position with Scripter but I only get 0 0, even if I simply have a shape in the middle of a transparent layer (small than the canvas size). You can find a code snippet there: https://forum.kde.org/viewtopic.php?f=139&t=151787 Thanks for taking a look !
I am not sure exactly what that property is supposed to be returning, but it is not very obvious. When I run your script from the forum I get values returned that are not 0, but I can't tell what it is getting back. The node position might be getting a value that is outside the image region. Sometimes when I resize with the crop tool and run that command I get negative numbers.
Git commit e54fb7a2173e61661d22fedabbad6573386c4ddc by Boudewijn Rempt. Committed on 13/08/2018 at 14:59. Pushed by rempt into branch 'master'. Clarify apidox for Node.position() M +3 -1 libs/libkis/Node.h https://commits.kde.org/krita/e54fb7a2173e61661d22fedabbad6573386c4ddc
This returns the position of the layer: that is the offset in the image stack, not the topleft of the bounds around the visible pixels. The position only changes if you move the layer. I've clarified the apidox.
Git commit 7a7b45847a07d3b20fc21b9980a9f8bbbee16f8a by Boudewijn Rempt. Committed on 07/09/2018 at 12:36. Pushed by rempt into branch 'krita/4.1'. Clarify apidox for Node.position() M +3 -1 libs/libkis/Node.h https://commits.kde.org/krita/7a7b45847a07d3b20fc21b9980a9f8bbbee16f8a
@Boudewijn Rempt Thanks ! But then, how to get "the topleft of the bounds around the visible pixels." ?