X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Ftterminal%2FECMA48.java;h=31bb5b1573cda8d66922036a40027e117b52e83f;hb=6f8ff91a29056209f9fd5f40e2dcf1ae285e0210;hp=96f4e4083cc0bba8085d2df1311492214142017d;hpb=499fdccfad144aa58869d839d50edb898670626a;p=fanfix.git diff --git a/src/jexer/tterminal/ECMA48.java b/src/jexer/tterminal/ECMA48.java index 96f4e40..31bb5b1 100644 --- a/src/jexer/tterminal/ECMA48.java +++ b/src/jexer/tterminal/ECMA48.java @@ -567,9 +567,11 @@ public class ECMA48 implements Runnable { * @param height the new height */ public final void setHeight(final int height) { + int delta = height - this.height; this.height = height; - if (scrollRegionBottom >= height) { - scrollRegionBottom = height - 1; + scrollRegionBottom += delta; + if (scrollRegionBottom < 0) { + scrollRegionBottom = height; } if (scrollRegionTop >= scrollRegionBottom) { scrollRegionTop = 0;