I have a CGRect A
and CGRect B
where B
is centered inside of A
(a CGRect
contains the x and y origin and height and width size of a rectangle). If I increase the width and height of A
by some proportion, and also increase the width and height of B
by that same proportion, will multiplying the x origin of B
and the y origin of B
by this same proportion (for the width and height respectfully), will that keep B
in the center of A
as both grow by the new proportion? I've tested this out in a few different scenarios and it works, but just wanted to verify it'll work for all situations as I am not that sharp in math.
Also, was wondering if there is a method that will simply allow you to multiply all values of a CGRect
by this proportion without having to do it manually (couldn't find one in the docs).
UPDATE: Actually, this will not work...trying to think of a methodology that will allow me to correctly position a view within another view after a proportional increase in size for both.