mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 13:00:47 +00:00
folder preview panel hack + small fixes
This commit is contained in:
@@ -168,7 +168,7 @@ public class Configuration {
|
||||
public static final ConfigurationItem<String> locale = null;
|
||||
@ConfigurationDefaultString("_loc%d_")
|
||||
public static final ConfigurationItem<String> registerNameFormat = null;
|
||||
@ConfigurationDefaultInt(8)
|
||||
@ConfigurationDefaultInt(10)
|
||||
public static final ConfigurationItem<Integer> maxRecentFileCount = null;
|
||||
public static final ConfigurationItem<String> recentFiles = null;
|
||||
public static final ConfigurationItem<String> fontPairing = null;
|
||||
@@ -338,7 +338,7 @@ public class Configuration {
|
||||
recentFilesArray.remove(idx);
|
||||
}
|
||||
recentFilesArray.add(path);
|
||||
while (recentFilesArray.size() >= maxRecentFileCount.get()) {
|
||||
while (recentFilesArray.size() > maxRecentFileCount.get()) {
|
||||
recentFilesArray.remove(0);
|
||||
}
|
||||
recentFiles.set(Helper.joinStrings(recentFilesArray, "::"));
|
||||
|
||||
@@ -80,9 +80,17 @@ public class PreviewImage extends JPanel {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
// todo:
|
||||
// call repaint on MainPanel.folderPreviewPanel
|
||||
// this is a hack, but otherwise the preview panel looks crazy sometimes
|
||||
// how to handle it in a better way?
|
||||
// normally repaint() on this panel should be enough
|
||||
Component parent = getParent();
|
||||
if (parent != null) {
|
||||
parent.repaint();
|
||||
parent = parent.getParent();
|
||||
if (parent != null) {
|
||||
parent.repaint();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -796,18 +796,18 @@ public class Helper {
|
||||
Rectangle rectangle = new Rectangle();
|
||||
int y1, y2;
|
||||
for (int x = 0; x < image.getWidth(); x++) {
|
||||
y1 = 99;
|
||||
y1 = Integer.MAX_VALUE;
|
||||
y2 = -1;
|
||||
for (int y = 0; y < image.getHeight(); y++) {
|
||||
int rgb = image.getRGB(x, y);
|
||||
rgb = rgb >>> 24;
|
||||
if (rgb > 0) {
|
||||
if (y1 == 99) {
|
||||
if (y1 == Integer.MAX_VALUE) {
|
||||
y1 = y;
|
||||
y2 = y;
|
||||
}
|
||||
if (y > (y2 + 1)) {
|
||||
rectangle.setBounds(x, y1, 1, y2 - y1);
|
||||
rectangle.setBounds(x, y1, 1, y2 - y1 + 1);
|
||||
area.add(new Area(rectangle));
|
||||
y1 = y;
|
||||
}
|
||||
@@ -815,7 +815,7 @@ public class Helper {
|
||||
}
|
||||
}
|
||||
if ((y2 - y1) >= 0) {
|
||||
rectangle.setBounds(x, y1, 1, y2 - y1);
|
||||
rectangle.setBounds(x, y1, 1, y2 - y1 + 1);
|
||||
area.add(new Area(rectangle));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user