X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fio%2FScreen.java;h=29c8485f95b837d41fece27f6b9c02af6c90cd7a;hb=30bd4abd2a85c162bdf0a1cc687b366345182bc1;hp=eab9650d14aac19735f732b78036e3fcf7d28d2d;hpb=84614868e6bcbe374c0c1ba248ad046ff25ccb2b;p=fanfix.git diff --git a/src/jexer/io/Screen.java b/src/jexer/io/Screen.java index eab9650..29c8485 100644 --- a/src/jexer/io/Screen.java +++ b/src/jexer/io/Screen.java @@ -216,7 +216,9 @@ public abstract class Screen { */ public final CellAttributes getAttrXY(final int x, final int y) { CellAttributes attr = new CellAttributes(); - attr.setTo(logical[x][y]); + if ((x >= 0) && (x < width) && (y >= 0) && (y < height)) { + attr.setTo(logical[x][y]); + } return attr; } @@ -727,7 +729,7 @@ public abstract class Screen { * Subclasses must provide an implementation to push the logical screen * to the physical device. */ - abstract public void flushPhysical(); + public abstract void flushPhysical(); /** * Put the cursor at (x,y). @@ -736,8 +738,7 @@ public abstract class Screen { * @param x column coordinate to put the cursor on * @param y row coordinate to put the cursor on */ - public final void putCursor(final boolean visible, - final int x, final int y) { + public void putCursor(final boolean visible, final int x, final int y) { cursorVisible = visible; cursorX = x;