if (width > height) {
            x = diff;
            width = width - diff;
        } else if (height > width) {
            y = diff;