#35 fix demo
[fanfix.git] / src / jexer / backend / LogicalScreen.java
index 9af633dbac645be3198a27935590d6145143b9cc..558fdc4812c1e553b1434e0b1d6c173dc4ef0469 100644 (file)
@@ -967,27 +967,28 @@ public class LogicalScreen implements Screen {
     public final void putFullwidthCharXY(final int x, final int y,
         final Cell cell) {
 
-        if (lastTextHeight != getTextHeight()) {
-            glyphMaker = GlyphMaker.getInstance(getTextHeight());
-            lastTextHeight = getTextHeight();
+        int cellWidth = getTextWidth();
+        int cellHeight = getTextHeight();
+
+        if (lastTextHeight != cellHeight) {
+            glyphMaker = GlyphMaker.getInstance(cellHeight);
+            lastTextHeight = cellHeight;
         }
-        BufferedImage image = glyphMaker.getImage(cell, getTextWidth() * 2,
-            getTextHeight());
-        BufferedImage leftImage = image.getSubimage(0, 0, getTextWidth(),
-            getTextHeight());
-        BufferedImage rightImage = image.getSubimage(getTextWidth(), 0,
-            getTextWidth(), getTextHeight());
-
-        Cell left = new Cell();
-        left.setTo(cell);
+        BufferedImage image = glyphMaker.getImage(cell, cellWidth * 2,
+            cellHeight);
+        BufferedImage leftImage = image.getSubimage(0, 0, cellWidth,
+            cellHeight);
+        BufferedImage rightImage = image.getSubimage(cellWidth, 0, cellWidth,
+            cellHeight);
+
+        Cell left = new Cell(cell);
         left.setImage(leftImage);
         left.setWidth(Cell.Width.LEFT);
         // Blank out the char itself, so that shadows do not leave artifacts.
         left.setChar(' ');
         putCharXY(x, y, left);
 
-        Cell right = new Cell();
-        right.setTo(cell);
+        Cell right = new Cell(cell);
         right.setImage(rightImage);
         right.setWidth(Cell.Width.RIGHT);
         // Blank out the char itself, so that shadows do not leave artifacts.
@@ -1006,8 +1007,7 @@ public class LogicalScreen implements Screen {
     public final void putFullwidthCharXY(final int x, final int y,
         final char ch, final CellAttributes attr) {
 
-        Cell cell = new Cell(ch);
-        cell.setAttr(attr);
+        Cell cell = new Cell(ch, attr);
         putFullwidthCharXY(x, y, cell);
     }