This is the description I came up with. I left the original comment after the new stuff. Comments?
// Transform the specified attribute (width/height/x/y) from the existing // coordinate space to the reference view's coordinate space. This // transformation takes into account any nested views between the views and // the common ancestor view. // // This method answers the question: what should this view set its // width/height/x/y to in order to appear to have the same value for that // attribute as the reference view? // // @param String prop: a string specifying the property to return. // known properties are: x, y, width, and height // @param LzView refView: the reference view for the transformation Phil BTW, I moved GetAttributeRelative() to LzView. I modified LaszloView.lzx, LzSprite.js and LzSprite.as. Expect a review shortly. >This is a doc-worthy description. I'm ambivalent about whether users need >to know about LzViewLinkage. > >A > >On Oct 7, P T Withington wrote: > > > [Adding Adam, Laszlo-Dev. If Adam agrees with my description, perhaps > > you could use this to enhance the documentation.] > > > > In LZX, each View can have a transformation matrix, which applies to > > the view and all it's child views. GetAttributeRelative takes two > > views, composes the transforms between those views (there may be > > intervening views with transforms, or they may only share a common > > ancestor), and then applies that composed transform to the attribute. > > In theory. The code in each of the Sprite implementations seems to be > > limited to a few special cases. > > > > In English, getAttributeRelative is translating a dimension from one > > view's coordinate space to another views's. > > > > Now that LzViewLinkage is portable, I think you should be able to > > write a portable version of GetAttributeRelative. LzView.getLinkage > > computes the transform you need, so all you should have to do is get > > the linkage, make sure it is up to date, and then apply the transform > > to the attribute you need. (Linkage is actually incomplete, as it only > > computes translation and scaling, it does not include rotation, but > > that seems to suffice for now.) > > > > [Max will tell you that DHTML does not implement the full LZX > > semantics of transformations, yet; but that doesn't mean you can't > > write a portable solution that works for what _is_ implemented.] _______________________________________________ Laszlo-dev mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
