Andy Humphries escreveu:
You can use:
yourView.getAttributeRelative('x',canvas);
yourView.getAttributeRelative('y',canvas);
Ouch! on the nail, thanks Andy.
LzView.getAttributeRelative will do the job.
I just wrote something like this, but I think it has the same bug as 3.3:
<method name="getGlobal" args="obj,attr">
var rv = obj[attr];
while(true) {
if(obj instanceof lz.canvas) {
return(rv);
}
obj = obj.parent;
rv += obj[attr];
}
</method>
Details of getAttributeRelative are in reference documentation for view.
There is a bug (at version 3.3) in which this does not return the
correct answer if there is a scaled view in "yourView" hierarchy.
Cheers,
Andy
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paulo Scardine
Sent: 27 August 2008 15:05
To: [email protected]
Subject: [Laszlo-user] absolute x,y (relative to canvas)
Hi,
Is there any way to know the absolute x and y canvas coordinates of a
view whose parent is not the canvas without traversing down the parents
hierarchy?
Thanks in advance,
--
Paulo