X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Ftterminal%2FECMA48.java;h=4bf7efbc3b6c10c4264f6a2288fc7803923628a4;hb=bfecf074da5a84cfe33ba88351d36ed61601448b;hp=7d03db1372aee15f9508000fbcd9585137ce41de;hpb=29dcb86139ca38dd4ff2bde6fe2f1d2227d6d815;p=fanfix.git diff --git a/src/jexer/tterminal/ECMA48.java b/src/jexer/tterminal/ECMA48.java index 7d03db1..4bf7efb 100644 --- a/src/jexer/tterminal/ECMA48.java +++ b/src/jexer/tterminal/ECMA48.java @@ -7023,19 +7023,20 @@ public class ECMA48 implements Runnable { int x0 = currentState.cursorX; for (int y = 0; y < cellRows; y++) { for (int x = 0; x < cellColumns; x++) { - printCharacter(' '); - cursorLeft(1, false); - if ((x == cellColumns - 1) || (y == cellRows - 1)) { - // TODO: render text of current cell first, then image - // over it. For now, just copy the cell. - DisplayLine line = display.get(currentState.cursorY); - line.replace(currentState.cursorX, cells[x][y]); - } else { - // Copy the image cell into the display. - DisplayLine line = display.get(currentState.cursorY); - line.replace(currentState.cursorX, cells[x][y]); + assert (currentState.cursorX <= rightMargin); + + // TODO: Render text of current cell first, then image over + // it (accounting for blank pixels). For now, just copy the + // cell. + DisplayLine line = display.get(currentState.cursorY); + line.replace(currentState.cursorX, cells[x][y]); + + // If at the end of the visible screen, stop. + if (currentState.cursorX == rightMargin) { + break; } - cursorRight(1, false); + // Room for more image on the visible screen. + currentState.cursorX++; } linefeed(); cursorPosition(currentState.cursorY, x0);