Skip to main content
Tuoman
Senior II
Mar 16, 2020 7:54 AM UTC
Question

Get absolute position of a Drawable?

Is there function to get absolute position of Drawable? getX() returns relative position within container.

So if I have 3 nested containers, I must do:

container1->getX() + container2->getX() + container3->getX() + drawable1->getX()

Is this the intended way, or am I missing something?

This topic has been closed for replies.

1 reply

LTimm.1
Associate
Mar 16, 2020 8:08 AM UTC

I haven't tried it myself lately, so a bit unsure, but maybe Drawable::getAbsoluteRect() is what you are looking for.