for (int y = 0; y < height; ++y) {
for (int x = 0; x < width; ++x) {
int px = (x + offX) * scale;
int py = (y + offY) * scale;
Rect2i area = Rect2i.createFromMinAndSize(px, py, scale, scale);
Color c = previewGenerator.get(layerName, area);
c.addToBuffer(buf);
}
if (Thread.currentThread().isInterrupted()) {
throw new InterruptedException();
}
if (progressListener != null) {