*/
  private void updateMouseAutoScroll(Point point) {
    // FIXME: This entire thing is some huge pile of fail.
    // It scrolls too slowly and causes viewport issues.
    if (!(getParent() instanceof JViewport)) {
      return;
    }

    JViewport p = ((JViewport) getParent());
    Rectangle vr = p.getViewRect();
    Point rp = new Point(0, 0);

    if (point.x > vr.x + vr.width) {
      rp.x += Math.pow(3, Math.max(0, Math.log10(point.x - vr.x - vr.width) - 1));
    }
    if (point.x < vr.x) {
      rp.x -= Math.pow(3, Math.max(0, Math.log10(vr.x - point.x) - 1));
    }
    if (point.y > vr.y + vr.height) {
      rp.y += Math.pow(5, Math.max(0, Math.log10(point.y - vr.y - vr.height) - 1));
    }
    if (point.y < vr.y) {
      rp.y -= Math.pow(5, Math.max(0, Math.log10(vr.y - point.y) - 1));
    }

    rp.x = Math.max(0, Math.min(maxRowSize, rp.x));
    rp.y = Math.max(0, Math.min(code.size() * lineHeight - vr.height, rp.y));
    mas.p = p;
    mas.rp = rp;
    if (rp.x != 0 || rp.y != 0) {
      mas.start();
    } else {
      mas.stop();
    }
  }