Examples of calculateLineTop()


Examples of com.google.collide.client.editor.Buffer.calculateLineTop()

    SelectionModel selectionModel = editor.getSelection();
    Buffer buffer = editor.getBuffer();

    int cursorLineNumber = selectionModel.getCursorLineNumber();
    int cursorScrollTopOffset = buffer.calculateLineTop(cursorLineNumber) - buffer.getScrollTop();

    selections.put(fileEditSessionKey, new Selection(selectionModel.getBaseLineNumber(),
        selectionModel.getBaseColumn(), cursorLineNumber, selectionModel.getCursorColumn(),
        cursorScrollTopOffset));
  }
View Full Code Here

Examples of com.google.collide.client.editor.Buffer.calculateLineTop()

    // Defer to match editor's initially deferred scrolling
    Scheduler.get().scheduleDeferred(new ScheduledCommand() {
      @Override
      public void execute() {
        Buffer buffer = editor.getBuffer();
        int targetScrollTop = buffer.calculateLineTop(cursorLineInfo.number())
            - selection.cursorScrollTopOffset;
        buffer.setScrollTop(Math.max(0, targetScrollTop));
      }
    });
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.