#272 Changed calculation of maximum z-index, when content is distorted