I am trying to draw a simple Rect on a canvas that is at the X coordinate of 360, and the Y coordinate of 0. I can draw my Rect if I make the X coordinate of 0, but when I do 360, the square is distorted and becomes a rectangular shape, not the square. The screen size is 640 pixels, so there should be no problems. I can draw bitmaps with the same specifications, and it will paint fine. Why doesn't Rect draw correctly? Is it somehow that the X coordinate is only in DP, and not in PX? Then why does this affect the actual size of the rect? I'm really confused.
Rect square6 = new Rect(); square6.set(360, 0, 60, 60);
source share