This fixes the reported bug, but I'm still not convinced that the math is 
completely correct.  Unless I misunderstand completely, I feel the following 
two assertions should also hold in the supplied test case:

  assertEquals((yellowview.x+redview.x)*blueview.xscale,
               redview.getAttributeRelative('x', blueview), "red x in blue")
  assertEquals((yellowview.x+redview.x)/(- blueview.xscale),
               blueview.getAttributeRelative('x', redview), "blue x in red")

they currently fail, even with your change applied.

So, I approve your change as far as it goes, but could you either re-open it, 
or open a new bug, with the above tests?

And also, you implied you had a general test case for getAttributeRelative.  It 
seems the test from LPP-9333 (and my two additional test cases) should be added 
to that test.  Is this test a part of lztest?  It would be good if it was.
 
On 2010-08-31, at 19:33, Max Carlson wrote:

> I'm going to go ahead and commit this one since it's so dead simple/obvious.
> 
> Change maxcarlson-20100831-WF8 by maxcarl...@friendly on 2010-08-31 16:31:44 
> PDT
>    in /Users/maxcarlson/openlaszlo/trunk2
>    for http://svn.openlaszlo.org/openlaszlo/trunk
> 
> Summary: Fix getAttributeRelative('x/y') calls for scaled views
> 
> Bugs Fixed: LPP-9333 - lz.view getAttributeRelative() doesn't work with 
> nested views inside a view that has xscale/yscale
> 
> Technical Reviewer: ptw
> QA Reviewer: kathryn aaker <[email protected]>
> 
> Details: There was an order of operations bug.  The offset should be added to 
> the x/y _before_ scaling is applied.
> 
> Tests: See LPP-9333 in dhtml/swf10
> 
> Files:
> M       WEB-INF/lps/lfc/views/LaszloView.lzs
> 
> Changeset: 
> http://svn.openlaszlo.org/openlaszlo/patches/maxcarlson-20100831-WF8.tar


Reply via email to