x/y resizing depending on layout