X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fbackend%2FSwingTerminal.java;h=f5d15447b37eca234bd460476a088cdfa94a41b8;hb=e13561306e98c5ec88a84d0fa4bfabbd584239df;hp=58b8f799cf7f1e1153f2ef60f2af486ba96d03da;hpb=027de5ae322ef58d3bc74051d3aa20847455361a;p=nikiroo-utils.git diff --git a/src/jexer/backend/SwingTerminal.java b/src/jexer/backend/SwingTerminal.java index 58b8f79..f5d1544 100644 --- a/src/jexer/backend/SwingTerminal.java +++ b/src/jexer/backend/SwingTerminal.java @@ -572,6 +572,7 @@ public class SwingTerminal extends LogicalScreen && (swing.getBufferStrategy() != null) ) { do { + clearPhysical(); do { drawToSwing(); } while (swing.getBufferStrategy().contentsRestored()); @@ -1265,18 +1266,31 @@ public class SwingTerminal extends LogicalScreen int xPixel = cursorX * textWidth + left; int yPixel = cursorY * textHeight + top; Cell lCell = logical[cursorX][cursorY]; + int cursorWidth = textWidth; + switch (lCell.getWidth()) { + case SINGLE: + // NOP + break; + case LEFT: + cursorWidth *= 2; + break; + case RIGHT: + cursorWidth *= 2; + xPixel -= textWidth; + break; + } gr.setColor(attrToForegroundColor(lCell)); switch (cursorStyle) { default: // Fall through... case UNDERLINE: - gr.fillRect(xPixel, yPixel + textHeight - 2, textWidth, 2); + gr.fillRect(xPixel, yPixel + textHeight - 2, cursorWidth, 2); break; case BLOCK: - gr.fillRect(xPixel, yPixel, textWidth, textHeight); + gr.fillRect(xPixel, yPixel, cursorWidth, textHeight); break; case OUTLINE: - gr.drawRect(xPixel, yPixel, textWidth - 1, textHeight - 1); + gr.drawRect(xPixel, yPixel, cursorWidth - 1, textHeight - 1); break; } }