NSScrollview scrolling

Hi !
I have a problem with scrolling (and zooming) an NSView in A NSScrollView.
I have a View (fixed size 3000,2000) that I embedded into a scrollview.
When I scroll to the right bottom end, every looks fine. But when I increase the size of the window the view expands.
Is this the normal behavior?
How can I limit the displayed view to its fixed sizes?
How do I set the size of the NSView programmatically?
(I want to have portrait and landscape)

Scrolling:
https://github.com/frcocoatst/ScrollViewTest

I added some zooming feature, but here I have some clipping problems
Zooming

https://github.com/frcocoatst/ScrollViewTestZooming

Kind Regards,
Fritz

The scrolling problem is fixed now by adding constraints.

But I would prefer to set the dimensions of the view in code.

I still have no idea how to fix the zooming …

Kind Regards,
Fritz