Fixed viewport and rendering

- background is now only rendered in the visible parts
- fixed viewport constraints calculation (breaks zoom origin)