1. Create a rectangular image (something clearly much longer than wider, the bug will not be visible with square images), lets say an image 100 px in height and 20 px in length.
2. read it into a variable of type Image , lets say named 'testImg'
2. try to display it at (10,200) rotated with
on all Symbians and Ashas <501, this will display a image 20 px high and 100 long , and VCENTERED around y=200. So the top left corner of the image will be at (10,200-testImg.getHeight()/2) = (10,190)
graphics.drawRegion(testImg,0,0,20,100,Sprite.TRANS_ROT270, 10, 200, Graphics.LEFT|Graphics.VCENTER );
On Asha 501 however, the image's top left corner will be at (10,150) !
The bug only happens when one uses the VCENTER anchor, and not with TOP or BOTTOM.
It's quite easy to see what happens: on Asha 501 the implementation of drawRegion , the top left corner is also at (10,200-testImg.getHeight()/2), but the getHeight() is computed before the rotation so we get (10,200-100/2) = (10,150).
What is not so easy to see is why Nokia keeps rewriting such pieces of code, and apparently giving the job to interns, and then obviously does no unit tests?