Added optional viewport for dynamicPositioning