I have a view that lets the user position and size a bunch of subviews. I use .frame()
and .position()
to accomplish this.
Right now, if the user resizes the window, the views stay where they are, anchored to the top-left corner. What I'd like is for the views to scale as a whole with window, maintaining their relative position, and their aspect ratios.
I can apply .scaleEffect(_:anchor:)
to the containing view, and it scales them the way I want, but I'm not sure how to tie it to the window.
My first thought is to use a GeometryReader
, but I don't really know what the "original" size would have been in order to compute a scale factor.
How else might I accomplish this?