Beispiel #1
0
  public Dimension resize(final Dimension pendingResize, final RequestOrigin origin) {
    final int oldHeight = myTerminalHeight;
    if (pendingResize.width <= MIN_WIDTH) {
      pendingResize.setSize(MIN_WIDTH, pendingResize.height);
    }
    final Dimension pixelSize =
        myDisplay.requestResize(
            pendingResize,
            origin,
            myCursorY,
            new ResizeHandler() {
              @Override
              public void sizeUpdated(int termWidth, int termHeight, int cursorY) {
                myTerminalWidth = termWidth;
                myTerminalHeight = termHeight;
                myCursorY = cursorY;
                myCursorX = Math.min(myCursorX, myTerminalWidth - 1);

                myTabulator.resize(myTerminalWidth);
              }
            });

    myScrollRegionBottom += myTerminalHeight - oldHeight;
    return pixelSize;
  }