Okay you have an array of concentric rectangles: each concentric rectangle has a type:
{
outer: {
width,
height,
},
inner: {
width,
height,
x,
y,
}
}
where outer is the outer rectangle, inner is the inner rectangle, inner's x and y are the position of the inner rectangle relative to the top left corner of the outer rectangle.
Write an algorithm that lines up rectangles horizontally based on the bottom edge of the inner rectangle, and calculates the min height of a container and x,y offsets of each rectangle within the container. Do no scale any individual rectangle, they must be kept in proportion to each other.
real use-case: lining up iphone mocks