Ejemplo n.º 1
0
  public Rectangle getPositionBounds(InputEditorPosition position) {
    Renderer renderer = widget_.getEditor().getRenderer();

    Position pos = ((AceInputEditorPosition) position).getValue();

    ScreenCoordinates start = renderer.textToScreenCoordinates(pos.getRow(), pos.getColumn());

    return new Rectangle(
        start.getPageX(),
        start.getPageY(),
        (int) Math.round(renderer.getCharacterWidth()),
        (int) (renderer.getLineHeight() * 0.8));
  }
Ejemplo n.º 2
0
 public Rectangle getCursorBounds() {
   Range range = getSession().getSelection().getRange();
   Renderer renderer = widget_.getEditor().getRenderer();
   ScreenCoordinates start =
       renderer.textToScreenCoordinates(range.getStart().getRow(), range.getStart().getColumn());
   ScreenCoordinates end =
       renderer.textToScreenCoordinates(range.getEnd().getRow(), range.getEnd().getColumn());
   return new Rectangle(
       start.getPageX(),
       start.getPageY(),
       end.getPageX() - start.getPageX(),
       renderer.getLineHeight());
 }