Gave getMetrics a draw context
Remove app as a dependency on window - made theApp global.