public void updateSize(float width, float height) { if (size.x == width && size.y == height) return; // Put back the size adjustment we made in the first place horzFolds[1] -= size.x - imageSize.x; vertFolds[1] -= size.y - imageSize.y; size.set(width, height); // Adjust the middle fold for the new size horzFolds[1] += size.x - imageSize.x; vertFolds[1] += size.y - imageSize.y; refreshGeometry(); }