[android-developers] simple matrix question

2013-01-31 Thread dashman
this is the onDraw method for my View sub-class drawCross() is a simple method that draws a cross. shouldn't this code result in overlapping crosses. trying to understand the translate method. drawCross( canvas, 200, 400 ); // no transformations Matrix m = new

Re: [android-developers] simple matrix question

2013-01-31 Thread Romain Guy
Calling setMatrix() will override the existing transforms set on the Canvas. The Canvas passed to View.onDraw() may already have transforms set to draw in the correct location. Instead of using setMatrix(), using Canvas.translate(), Canvas.scale(), etc. Don't forget to use Canvas.save() and