use window height for viewport height instead of document height

translation from relative to absolute coordinates should be (as it is in documentation and also it is somehow logical) relative to browser's viewport edges. Thus viewport height is not document height but browser's window inner height.