From be528f1aa647a2b7afd8b401e67480586e3b63a6 Mon Sep 17 00:00:00 2001 From: Kevin Lamonte Date: Fri, 2 Aug 2019 14:00:14 -0500 Subject: [PATCH] #36 Use image scaling in example --- examples/JexerImageViewer.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/examples/JexerImageViewer.java b/examples/JexerImageViewer.java index 8269606..437aa8e 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); -- 2.27.0