That link was very useful to understand how the pivot point works, now I understand it perfectly. I was using 48, 48 as pivot and I didn't realized that was the middle X and middle of my drawable (it sizes 96x96) so that's because it rotate properly.
Thank you very much. On Sep 18, 1:51 pm, Kostya Vasilyev <[email protected]> wrote: > The coordinates are the rotation's center point (called the pivot > point in the docs). > > See here for an interactive demo: > > http://www.nbilyk.com/pivot-rotate-example > > If you set these coordinates to the center of the canvas, you'll get the > most intuitive result. But other rotations are possible as shown in the > link above. > > -- Kostya > > 18.09.2010 13:37, [email protected] пишет: > > > > > > > Can anybody explain me what is exactly that coordinates? I have search > > for information but can't find properly info. > > I have some drawables objects wich I need to rotate, I have realized I > > need to add a constant value to that coordinates, if not they rotate > > wrong. > > > I use this way: > > > =========================================================================== > > =============== > > canvas.save(); > > canvas.rotate(90 * mRotatationType, CTE_ROTATING_X_POINT + coordX, > > CTE_ROTATING_Y_POINT + coordY); > > canvas.restore; > > =========================================================================== > > =============== > > > Where: > > -mRotatationType: is set to 0, 1, 2, or 3 in order to get a 0, 90, > > 180, 270º rotation. > > -coordX and coordY are the top/left points of my drawable object. > > -CTE_ROTATING_X_POINT and CTE_ROTATING_Y_POINT are set to "48" (if not > > the drawables move in a different place after rotate). This is the > > mistery for me. > > -- > Kostya Vasilyev -- WiFi Manager + pretty widget > --http://kmansoft.wordpress.com -- 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

