Changes between Initial Version and Version 1 of Ticket #22695, comment 1


Ignore:
Timestamp:
2023-01-31T23:48:53+01:00 (3 years ago)
Author:
Woazboat

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #22695, comment 1

    initial v1  
    332) 90 degree offset of `*-rotation: way;` compared to `*-rotation: <fixed angle>`
    44
    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 start at the y-axis (north) going in the clockwise direction.
     5The 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.
    66The 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).