Changes between Initial Version and Version 1 of Ticket #22695, comment 1
- Timestamp:
- 2023-01-31T23:48:53+01:00 (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #22695, comment 1
initial v1 3 3 2) 90 degree offset of `*-rotation: way;` compared to `*-rotation: <fixed angle>` 4 4 5 The 90 degree offset occurs because https://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/tools/RotationAngle.java#L37 uses `Geometry.getSegmentAngle`, which calculates the angle using `Math.atan2` and therefore the rotation starting from the x-axis (east) in counter clockwise direction. The mapcss implementation expects the rotation to startat the y-axis (north) going in the clockwise direction.5 The 90 degree offset occurs because https://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/tools/RotationAngle.java#L37 uses `Geometry.getSegmentAngle`, which calculates the angle using `Math.atan2` and therefore the rotation starting from the x-axis (east) in counter clockwise direction. The icon rotation is relative to the icon and therefore 'starts' at the y-axis (north) going in the clockwise direction. 6 6 The returned angle is correctly inverted to fix the rotation angle, but the 90° offset is not corrected. This can be fixed by adding an offset of `- Math.PI/2` to the angle (`+Math.PI/2` if done after inversion).


