On Wed, Sep 1, 2010 at 3:39 PM, Max Carlson <[email protected]> wrote:
> On 9/1/10 8:22 AM, P T Withington wrote:
>
>> 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")
>>
>
> There's a bug in that one - you're not taking the blueview.x into account.
> This works:
> assertEquals((yellowview.x+redview.x)*blueview.xscale +
> (blueview.x), redview.getAttributeRelative('x', blueview), "red x in blue")
This is starting to make my head spin, but I don't think, in this case, that
the blue view's x matters, since that's its X relative to it's own parent,
and we're just trying to compare the inner (red) to the outer (blue) views.
K
>
>
> assertEquals((yellowview.x+redview.x)/(- blueview.xscale),
>> blueview.getAttributeRelative('x', redview), "blue x in
>> red")
>>
>
> This one still fails, and I'm not sure why. Instinct sez this has been
> broken for a long time. Digging...
>
>
> 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
>>>
>>
>>