small fixes

This commit is contained in:
honfika@gmail.com
2014-11-08 01:09:37 +01:00
parent eaefcb286a
commit 582e3d6a7b
2 changed files with 11 additions and 2 deletions

View File

@@ -185,8 +185,11 @@ public class FolderPreviewPanel extends JPanel {
}
g.fillRect(x * CELL_WIDTH, y * CELL_HEIGHT, CELL_WIDTH, CELL_HEIGHT);
if (cachedPreviews.contains(index)) {
BufferedImage img = cachedPreviews.get(index).getBufferedImage();
g.drawImage(img, x * CELL_WIDTH + BORDER_SIZE + PREVIEW_SIZE / 2 - img.getWidth() / 2, y * CELL_HEIGHT + BORDER_SIZE + PREVIEW_SIZE / 2 - img.getHeight() / 2, null);
SerializableImage sImg = cachedPreviews.get(index);
if (sImg != null) {
BufferedImage img = cachedPreviews.get(index).getBufferedImage();
g.drawImage(img, x * CELL_WIDTH + BORDER_SIZE + PREVIEW_SIZE / 2 - img.getWidth() / 2, y * CELL_HEIGHT + BORDER_SIZE + PREVIEW_SIZE / 2 - img.getHeight() / 2, null);
}
} else {
cachedPreviews.put(index, noImage);
renderImageTask(index, items.get(index));