diff --git a/src/userLocationMarker.js b/src/userLocationMarker.js index 173b296b35144e9050cdd775c98b03dcda15601b..26fcc8d4ba9280cf94e0f3208a036fad505cb42a 100644 --- a/src/userLocationMarker.js +++ b/src/userLocationMarker.js @@ -130,7 +130,15 @@ export class UserLocationMarker extends MapMarker { vfunc_snapshot(snapshot) { if (this.place.location.heading > -1) { + // rotate around the center of the icon + let {x, y, width, height} = this.get_allocation(); + let point = new Graphene.Point(); + + point.init(width / 2, height / 2); + snapshot.translate(point); snapshot.rotate(this.place.location.heading); + point.init(-width / 2, -height / 2); + snapshot.translate(point); } this.snapshot_child(this._image, snapshot);