On Sep 1, 2010, at 18:42, kathryn aaker <[email protected]> wrote:

> 
> 
> 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

Well the general contract of getAttributeRelative is to say "what value of x 
would you have to set in the reference view to be equal to the current value in 
the source view. So I think my tests are valid, even if they are not required 
for your application. Which is why I suggested they could be a separate bug. 

Reply via email to