tawfiqdawod / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

MyLocationOverlay icon changes it's size when rotating the map #447

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Enable mylocation and map rotation
2.When the mylocation icon appears - rotate the map.

What is the expected output? 
The mylocation icon rotates but doesn't change it's size
What do you see instead?
The mylocation icon rotates and changes it's size (see attached)

What version of the product are you using? On what operating system?
3.0.10, Android 4.1

Original issue reported on code.google.com by xealst...@gmail.com on 5 Jul 2013 at 7:18

GoogleCodeExporter commented 8 years ago
Hi,

It is an issue that happens to me also with rotation, both with the old 
MyLocationOverlay class and with the new MyLocationNewOverlay class.

I think the problem exists in method drawMyLocation at the 2 
mDirectionRotater.postScale calls for arrow and person icons.

What's their use?
If I comment the 2 postScale calls, the icon size change vanishes.

Regards.

Original comment by devemu...@gmail.com on 5 Jul 2013 at 8:21

GoogleCodeExporter commented 8 years ago
Thanks for pointing that postscale out as the culprit. Those scale calls are 
supposed to keep the icon unscaled during zoom operations. We need to fix this.

Original comment by kurtzm...@gmail.com on 5 Jul 2013 at 1:32

GoogleCodeExporter commented 8 years ago
When dealing with rotation, the way to get the *real* scale value is:

        // Calculate real scale including accounting for rotation
        float scaleX = (float) Math.sqrt(mMatrixValues[Matrix.MSCALE_X]
                * mMatrixValues[Matrix.MSCALE_X] + mMatrixValues[Matrix.MSKEW_Y]
                * mMatrixValues[Matrix.MSKEW_Y]);
        float scaleY = (float) Math.sqrt(mMatrixValues[Matrix.MSCALE_Y]
                * mMatrixValues[Matrix.MSCALE_Y] + mMatrixValues[Matrix.MSKEW_X]
                * mMatrixValues[Matrix.MSKEW_X]);

Original comment by kurtzm...@gmail.com on 12 Jul 2013 at 8:34

GoogleCodeExporter commented 8 years ago
This issue was updated by revision r1252.

Prevent location icon from scaling incorrectly with rotation.

Original comment by kurtzm...@gmail.com on 12 Jul 2013 at 8:38

GoogleCodeExporter commented 8 years ago
Please test and report back!

Original comment by kurtzm...@gmail.com on 12 Jul 2013 at 8:38

GoogleCodeExporter commented 8 years ago
Yes now it seems to work correctly.

Regards.

Original comment by devemu...@gmail.com on 13 Jul 2013 at 12:23

GoogleCodeExporter commented 8 years ago
This has been released in 4.0.

Original comment by kurtzm...@gmail.com on 25 Oct 2013 at 1:50