git://git.nikiroo.be
/
fanfix-jexer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b244142
)
#36 Use image scaling in example
author
Kevin Lamonte
<kevin.lamonte@gmail.com>
Fri, 2 Aug 2019 19:00:14 +0000
(14:00 -0500)
committer
Kevin Lamonte
<kevin.lamonte@gmail.com>
Fri, 2 Aug 2019 19:00:14 +0000
(14:00 -0500)
examples/JexerImageViewer.java
patch
|
blob
|
blame
|
history
diff --git
a/examples/JexerImageViewer.java
b/examples/JexerImageViewer.java
index 826960639df92c48306286bdaa9448c0381babcb..437aa8e712153f5a8dd56515094ac685cfb0456c 100644
(file)
--- 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);