Fixed debug info label position/content on the top of flash viewer to avoid unwanted initial scroll

This commit is contained in:
Jindra Petřík
2022-10-23 17:06:23 +02:00
parent 10b0875358
commit 30a58d8c8e
2 changed files with 12 additions and 4 deletions

View File

@@ -133,7 +133,9 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
private int mouseButton;
private final JLabel debugLabel = new JLabel("-");
private static final String DEFAULT_DEBUG_LABEL_TEXT = " - ";
private final JLabel debugLabel = new JLabel(DEFAULT_DEBUG_LABEL_TEXT);
private Point cursorPosition = null;
@@ -1288,7 +1290,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
if (selectedDepth > -1) {
showSelectedName();
} else {
debugLabel.setText(" - ");
debugLabel.setText(DEFAULT_DEBUG_LABEL_TEXT);
}
}
@@ -2230,7 +2232,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
}
if (first) {
ret.append(" - ");
ret.append(DEFAULT_DEBUG_LABEL_TEXT);
}
}
@@ -2240,7 +2242,12 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
iconPanel.setImg(img);
lastMouseOverButton = iconPanel.mouseOverButton;
iconPanel.mouseOverButton = renderContext.mouseOverButton;
debugLabel.setText(ret.toString());
if (ret.isEmpty()) {
debugLabel.setText(DEFAULT_DEBUG_LABEL_TEXT);
} else {
debugLabel.setText(ret.toString());
}
if (freeTransformDepth == -1) {
if (handCursor) {
iconPanel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));