Get dimensions from viewport size

Signed-off-by: Oleg Bulatov <oleg@bulatov.me>