ui: image viewer fix size first image
authorNiki Roo <niki@nikiroo.be>
Sun, 24 Mar 2019 17:37:45 +0000 (18:37 +0100)
committerNiki Roo <niki@nikiroo.be>
Sun, 24 Mar 2019 17:37:45 +0000 (18:37 +0100)
src/be/nikiroo/fanfix/reader/ui/GuiReaderViewerPanel.java

index 18f6aca577f760fddf4e163b1f4d120658f6bc2a..12d6be6b555b263f8662cf8082a3227e4d3be9ec 100644 (file)
@@ -201,6 +201,10 @@ public class GuiReaderViewerPanel extends JPanel {
 
                final Image img = chap.getParagraphs().get(i).getContentImage();
 
+               // prepare the viewport to get the right sizes later on
+               image.setIcon(null);
+               scroll.setViewportView(image);
+
                new Thread(new Runnable() {
                        @Override
                        public void run() {