Started using a matrix library and calculated the correct angle for the widget.