X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTImage.java;h=cd0ce96e0baf4523c64cb45527c01cbc4d1e1443;hb=12b90437b5f22c2ae6e9b9b14c3b62b60f6143e5;hp=c3e75bed0fd3f39ed9aa265a64fdc50e2e69a6bf;hpb=e6469faa3f6895ec0ff9b7592a7348a321898b71;p=fanfix.git diff --git a/src/jexer/TImage.java b/src/jexer/TImage.java index c3e75be..cd0ce96 100644 --- a/src/jexer/TImage.java +++ b/src/jexer/TImage.java @@ -216,7 +216,7 @@ public class TImage extends TWidget { @Override public void onMouseDown(final TMouseEvent mouse) { if (clickAction != null) { - clickAction.DO(); + clickAction.DO(this); return; } } @@ -366,25 +366,8 @@ public class TImage extends TWidget { * @param always if true, always resize the cells */ private void sizeToImage(final boolean always) { - int textWidth = 16; - int textHeight = 20; - - if (getScreen() instanceof SwingTerminal) { - SwingTerminal terminal = (SwingTerminal) getScreen(); - - textWidth = terminal.getTextWidth(); - textHeight = terminal.getTextHeight(); - } if (getScreen() instanceof MultiScreen) { - MultiScreen terminal = (MultiScreen) getScreen(); - - textWidth = terminal.getTextWidth(); - textHeight = terminal.getTextHeight(); - } else if (getScreen() instanceof ECMA48Terminal) { - ECMA48Terminal terminal = (ECMA48Terminal) getScreen(); - - textWidth = terminal.getTextWidth(); - textHeight = terminal.getTextHeight(); - } + int textWidth = getScreen().getTextWidth(); + int textHeight = getScreen().getTextHeight(); if (image == null) { image = rotateImage(originalImage, clockwise);