From 9ea772f938a57e8dfee8d6378044d0cad2a393d1 Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Tue, 2 Jun 2015 18:24:31 +0200 Subject: [PATCH] canvas::Map: remove rotation matrix on removing HDG node. Return to previous rotation if autorotation to HDG is disabled/removed. --- simgear/canvas/elements/CanvasMap.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/simgear/canvas/elements/CanvasMap.cxx b/simgear/canvas/elements/CanvasMap.cxx index ee60bf24..80710f50 100644 --- a/simgear/canvas/elements/CanvasMap.cxx +++ b/simgear/canvas/elements/CanvasMap.cxx @@ -128,7 +128,13 @@ namespace canvas // TODO remove from other node _geo_nodes.erase(child); else if( parent != _node && child->getName() == HDG ) + { _hdg_nodes.erase(child); + + // Remove rotation matrix (tf[0]) and return to element always being + // oriented upwards (or any orientation inside other matrices). + child->getParent()->removeChild("tf", 0); + } else return Element::childRemoved(parent, child); } -- 2.39.5