[Laszlo-user] absolute x,y (relative to canvas)
Paulo Scardine
paulo at scardine.com.br
Wed Aug 27 11:07:57 PDT 2008
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: laszlo-user-bounces at openlaszlo.org
> [mailto:laszlo-user-bounces at openlaszlo.org] On Behalf Of Paulo Scardine
> Sent: 27 August 2008 15:05
> To: laszlo-user at openlaszlo.org
> 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
>
More information about the Laszlo-user
mailing list