@tool
extends Control
## UI element that automatically rotates its children to invert the rotation of the element itself.

@onready var _last_rotation: float = rotation


func _ready() -> void:
	draw.connect(_on_draw)


func _on_draw() -> void:
	var d_rotation := rotation - _last_rotation
	for c: Node in get_children():
		if c is Control:
			(c as Control).rotation -= d_rotation
	_last_rotation = rotation
