Pay close attention to the anchor targets. In your first screenshots you anchor left to left, right to right, but then top and bottom are both anchored to bottom. Your solution simply reset the anchor targets to be closest to whatever they were closest to at the time -- so for example if the button was in the bottom right corner, they'd be relative to the bottom right (left to right, right to right, bottom to bottom, top to bottom).