The matrix returned by the Canvas is the sum of all transformations to
the point your view is being drawn. There's a single Canvas for all
Views on screen.

On Tue, Aug 31, 2010 at 12:26 PM, Joao Luis <[email protected]> wrote:
> Hi all.
>
> I might be completely off-base here, but I've spent the last two days
> trying to figure this out and, without success, you're my only hope.
>
> What I'm doing is simple:
>
>  * I have a canvas where I draw a circle with center on (10, 10),
> with radius = 5;
>
>  * Then, I obtain the canvas transformation matrix
>
>      > Matrix m = canvas.getMatrix();
>
>  * And then I create a new rectangle, I map it using the matrix and I
> use the canvas to draw it.
>
>      > RectF ri = new RectF(5, 5, 15, 15);
>      > RectF rf = new RectF();
>      >
>      > m.mapRect(rf, ri);
>      >
>      > canvas.drawRect(rf, p);
>
> My problem: basically, the rectangle is being drawn in a different
> position along the Y-axis.
>
> I outputed the transformation matrix and, by default, it is translated
> by zero in the X-axis and by 25.0 in the Y-axis.
>
> Please note that I made NO transformations, either translate, scale or
> rotate.
>
> I am unable to understand why this is happening and how to avoid it.
>
> Any help will be appreciated.
>
> Thanks.
>
> --J
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Romain Guy
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to