﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
22703	[Patch] Fix 90° offset of `icon-rotation: way;` in mapcss	Woazboat	team	"

The (undocumented) *-rotation: way;in mapcss has an offset of 90° compared to *-rotation: <fixed angle>

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.
The returned angle is already 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).


https://github.com/JOSM/josm/pull/109
https://github.com/JOSM/josm/pull/109.patch

See also #22695"	defect	closed	normal	23.02	Core mappaint		fixed		
