From: Kevin Lamonte Date: Fri, 2 Aug 2019 19:00:14 +0000 (-0500) Subject: #36 Use image scaling in example X-Git-Tag: fanfix-swing-0.0.1~12^2~13^2~125 X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=be528f1aa647a2b7afd8b401e67480586e3b63a6;p=fanfix-swing.git #36 Use image scaling in example --- diff --git a/examples/JexerImageViewer.java b/examples/JexerImageViewer.java index 82696063..437aa8e7 100644 --- a/examples/JexerImageViewer.java +++ b/examples/JexerImageViewer.java @@ -307,12 +307,8 @@ class ImageViewerDesktop extends TDesktop { imageWidget = new TImage(this, getWidth() - width, getHeight() - height, width, height, image, 0, 0, null); - // Resize the image down until it can fit within the pane. - while ((imageWidget.getRows() > height) - || (imageWidget.getColumns() > width) - ) { - imageWidget.onKeypress(new TKeypressEvent(kbAltDown)); - } + // Resize the image to fit within the pane. + imageWidget.setScaleType(TImage.Scale.SCALE); imageWidget.setActive(false); activate(directoryList);