Keep a row of objects within a boundary while scaling one

For a set of kitchen cabinets that are next to each other in a row and bounded with walls, I’m gonna find a proper way that when I’m scaling one of them others, proportionally change their size in order to keep them self within the boundary.
198494-111.jpg
198495-222.jpg
Actually I’m looking for a method of coding to handle them

@ssmas simple. State your boundary as you said. your main drawers or cabinets need a boundary. This is much like web design. You are stating your boundary space for a set of drawers or an entire cabinet and the boundary for the room itself. if you want the drawers to be fluid in one direction then you would simply use your boundary to scale it proportionally. So, if we have a 1 one left and a 1 on right. we can do math when we have 0.8 on left and 1.2 on right. they are effectual to always add up to 2. So, like a lever you would define each space by its number and say If (drawerB == 1.2) {drawerA == (2 - drawerB} this will always give a levy on proportional moving. You would replace your numbers by floats or vectors depending on your scope. There may be a better way however, I will often code something like this and then find ways to continuously shorten the method. Cheers!