Shouldn't the css property top or left be removed when changing aspect ratio on setFullscreen function? For example: you have left set to -100px shift, when you resize your window to the opposed aspect ratio so you have to add top ratio, the previous -100px are still set.