X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTTerminalWindow.java;h=d1853310349b80c6646d06b6b32e12ea72260cee;hb=1ef8557088a7777c783e51117dd5374669058852;hp=9780e29d7d6643ad0c032801c6605d3320b91052;hpb=69a8c36844309a07dfe7c8c7576d9c0e47be3303;p=nikiroo-utils.git diff --git a/src/jexer/TTerminalWindow.java b/src/jexer/TTerminalWindow.java index 9780e29..d185331 100644 --- a/src/jexer/TTerminalWindow.java +++ b/src/jexer/TTerminalWindow.java @@ -767,20 +767,8 @@ public class TTerminalWindow extends TScrollableWindow newStatusBar(i18n.getString("statusBarRunning")); // Pass the correct text cell width/height to the emulator - int textWidth = 16; - int textHeight = 20; - if (getScreen() instanceof SwingTerminal) { - SwingTerminal terminal = (SwingTerminal) getScreen(); - - textWidth = terminal.getTextWidth(); - textHeight = terminal.getTextHeight(); - } else if (getScreen() instanceof ECMA48Terminal) { - ECMA48Terminal terminal = (ECMA48Terminal) getScreen(); - textWidth = terminal.getTextWidth(); - textHeight = terminal.getTextHeight(); - } - emulator.setTextWidth(textWidth); - emulator.setTextHeight(textHeight); + emulator.setTextWidth(getScreen().getTextWidth()); + emulator.setTextHeight(getScreen().getTextHeight()); } /** @@ -961,15 +949,12 @@ public class TTerminalWindow extends TScrollableWindow private void putDoubleWidthCharXY(final DisplayLine line, final int x, final int y, final Cell cell) { - int textWidth = 16; - int textHeight = 20; + int textWidth = getScreen().getTextWidth(); + int textHeight = getScreen().getTextHeight(); boolean cursorBlinkVisible = true; if (getScreen() instanceof SwingTerminal) { SwingTerminal terminal = (SwingTerminal) getScreen(); - - textWidth = terminal.getTextWidth(); - textHeight = terminal.getTextHeight(); cursorBlinkVisible = terminal.getCursorBlinkVisible(); } else if (getScreen() instanceof ECMA48Terminal) { ECMA48Terminal terminal = (ECMA48Terminal) getScreen(); @@ -981,9 +966,6 @@ public class TTerminalWindow extends TScrollableWindow putCharXY(x + 1, y, ' ', cell); return; } - - textWidth = terminal.getTextWidth(); - textHeight = terminal.getTextHeight(); cursorBlinkVisible = blinkState; } else { // We don't know how to dray glyphs to this screen, draw them as @@ -1015,13 +997,8 @@ public class TTerminalWindow extends TScrollableWindow gr2.setFont(doubleFont); // Draw the background rectangle, then the foreground character. - if (getScreen() instanceof ECMA48Terminal) { - // BUG: the background color is coming in the same as the - // foreground color. For now, don't draw it. - } else { - gr2.setColor(SwingTerminal.attrToBackgroundColor(cell)); - gr2.fillRect(0, 0, image.getWidth(), image.getHeight()); - } + gr2.setColor(SwingTerminal.attrToBackgroundColor(cell)); + gr2.fillRect(0, 0, image.getWidth(), image.getHeight()); if (!cell.isBlink() || (cell.isBlink() && cursorBlinkVisible) ) {