From eea1c0a848465b54feb2648f426196e6ffb7a24f Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Sun, 24 Mar 2019 18:37:45 +0100 Subject: [PATCH] ui: image viewer fix size first image --- src/be/nikiroo/fanfix/reader/ui/GuiReaderViewerPanel.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/be/nikiroo/fanfix/reader/ui/GuiReaderViewerPanel.java b/src/be/nikiroo/fanfix/reader/ui/GuiReaderViewerPanel.java index 18f6aca..12d6be6 100644 --- a/src/be/nikiroo/fanfix/reader/ui/GuiReaderViewerPanel.java +++ b/src/be/nikiroo/fanfix/reader/ui/GuiReaderViewerPanel.java @@ -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() { -- 2.27.0