Change overlay positioning method.

In some cases, the previous method caused scrollbars to appear.