This forum has been archived. All content is frozen. Please use KDE Discuss instead.

API: Get Layer Top Left Position?

Tags: None
(comma "," separated)
User avatar
X-Raym
Registered Member
Posts
33
Karma
0

API: Get Layer Top Left Position?

Thu Apr 05, 2018 1:29 pm
Hi,

Still experimenting a bit with Krita Scripter,

How would you get layer top left position, as revealed by the transform tool ?

Screenshot

I tried the position() node method.

Code: Select all
from krita import *

w = Krita.instance().activeWindow()
v = w.activeView()

nodes = v.selectedNodes()
for i, node in enumerate( nodes ):
    pos = node.position()
    print( node.name() + "\t" + str( pos.x() ) + "\t" + str( pos.y() ) )


But it only output 0 for x and y.

Did I miss something ?

Thanks !

Last edited by X-Raym on Thu Apr 12, 2018 9:37 am, edited 1 time in total.


User avatar
X-Raym
Registered Member
Posts
33
Karma
0
Do you think I have to report that as a bug ? Or is it me who don't understand a key concept here ?


User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS
Um... I'm not really here. Just had Easter, and am now preparing for holidays. Please do make a bug report. If it's invalid or wrong or whatever, I'll close it after checking after my vacation, otherwise, I'll look into it.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], kde-naveen, Sogou [Bot], Yahoo [Bot]