Java Code Examples for com.intellij.openapi.editor.Editor#getLineHeight()

The following examples show how to use com.intellij.openapi.editor.Editor#getLineHeight() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: InlinePreviewViewController.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Override
public void paint(@NotNull Editor editor, @NotNull RangeHighlighter highlighter, @NotNull Graphics g) {
  if (editor != getEditor()) {
    // Don't want to render on the wrong editor. This shouldn't happen.
    return;
  }
  if (getEditor().isPurePaintingMode()) {
    // Don't show previews in pure mode.
    return;
  }
  if (!highlighter.isValid()) {
    return;
  }
  if (getDescriptor() != null && !getDescriptor().widget.isValid()) {
    return;
  }
  final int lineHeight = editor.getLineHeight();
  paint(g, lineHeight);
}
 
Example 2
Source File: DarculaEditorTextFieldUI.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Override
public Dimension getMinimumSize(JComponent c) {
  EditorTextField editorTextField = (EditorTextField)c;

  Editor editor = editorTextField.getEditor();

  Dimension size = JBUI.size(1, 10);
  if (editor != null) {
    size.height = editor.getLineHeight();

    size.height = Math.max(size.height, JBUIScale.scale(16));

    JBInsets.addTo(size, editorTextField.getInsets());
    JBInsets.addTo(size, editor.getInsets());
  }

  return size;
}
 
Example 3
Source File: PopupFactoryImpl.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Nullable
private static Point getVisibleBestPopupLocation(@Nonnull Editor editor) {
  VisualPosition visualPosition = editor.getUserData(ANCHOR_POPUP_POSITION);

  if (visualPosition == null) {
    CaretModel caretModel = editor.getCaretModel();
    if (caretModel.isUpToDate()) {
      visualPosition = caretModel.getVisualPosition();
    }
    else {
      visualPosition = editor.offsetToVisualPosition(caretModel.getOffset());
    }
  }

  final int lineHeight = editor.getLineHeight();
  Point p = editor.visualPositionToXY(visualPosition);
  p.y += lineHeight;

  final Rectangle visibleArea = editor.getScrollingModel().getVisibleArea();
  return !visibleArea.contains(p) && !visibleArea.contains(p.x, p.y - lineHeight) ? null : p;
}
 
Example 4
Source File: LineTooltipRenderer.java    From consulo with Apache License 2.0 6 votes vote down vote up
private static void locateOutsideMouseCursor(Editor editor, JComponent editorComponent, Point p, int width, int height, int heightLimit) {
  PointerInfo pointerInfo = MouseInfo.getPointerInfo();
  if (pointerInfo == null) return;
  Point mouse = pointerInfo.getLocation();
  SwingUtilities.convertPointFromScreen(mouse, editorComponent);
  Rectangle tooltipRect = new Rectangle(p, new Dimension(width, height));
  // should show at least one line apart
  tooltipRect.setBounds(tooltipRect.x, tooltipRect.y - editor.getLineHeight(), width, height + 2 * editor.getLineHeight());
  if (tooltipRect.contains(mouse)) {
    if (mouse.y + height + editor.getLineHeight() > heightLimit && mouse.y - height - editor.getLineHeight() > 0) {
      p.y = mouse.y - height - editor.getLineHeight();
    }
    else {
      p.y = mouse.y + editor.getLineHeight();
    }
  }
}
 
Example 5
Source File: EditorFragmentComponent.java    From consulo with Apache License 2.0 6 votes vote down vote up
public static int getAvailableVisualLinesAboveEditor(@Nonnull Editor editor) {
  int availableVisualLines = 2;
  JComponent editorComponent = editor.getComponent();
  Container editorComponentParent = editorComponent.getParent();
  if (editorComponentParent != null) {
    JRootPane rootPane = editorComponent.getRootPane();
    if (rootPane != null) {
      Container contentPane = rootPane.getContentPane();
      if (contentPane != null) {
        int y = SwingUtilities.convertPoint(editorComponentParent, editorComponent.getLocation(), contentPane).y;
        int visualLines = y / editor.getLineHeight();
        availableVisualLines = Math.max(availableVisualLines, visualLines);
      }
    }
  }
  return availableVisualLines;
}
 
Example 6
Source File: InlinePreviewViewController.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Override
public void paint(@NotNull Editor editor, @NotNull RangeHighlighter highlighter, @NotNull Graphics g) {
  if (editor != getEditor()) {
    // Don't want to render on the wrong editor. This shouldn't happen.
    return;
  }
  if (getEditor().isPurePaintingMode()) {
    // Don't show previews in pure mode.
    return;
  }
  if (!highlighter.isValid()) {
    return;
  }
  if (getDescriptor() != null && !getDescriptor().widget.isValid()) {
    return;
  }
  final int lineHeight = editor.getLineHeight();
  paint(g, lineHeight);
}
 
Example 7
Source File: DiffDividerDrawUtil.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nonnull
public static List<DividerSeparator> createVisibleSeparators(@Nonnull Editor editor1,
                                                             @Nonnull Editor editor2,
                                                             @Nonnull DividerSeparatorPaintable paintable) {
  final List<DividerSeparator> separators = new ArrayList<DividerSeparator>();

  final Transformation[] transformations = new Transformation[]{getTransformation(editor1), getTransformation(editor2)};

  final Interval leftInterval = getVisibleInterval(editor1);
  final Interval rightInterval = getVisibleInterval(editor2);

  final int height1 = editor1.getLineHeight();
  final int height2 = editor2.getLineHeight();

  final EditorColorsScheme scheme = editor1.getColorsScheme();

  paintable.process(new DividerSeparatorPaintable.Handler() {
    @Override
    public boolean process(int line1, int line2) {
      if (leftInterval.startLine > line1 + 1 && rightInterval.startLine > line2 + 1) return true;
      if (leftInterval.endLine < line1 && rightInterval.endLine < line2) return false;

      separators.add(createSeparator(transformations, line1, line2, height1, height2, scheme));
      return true;
    }
  });

  return separators;
}
 
Example 8
Source File: EditorFragmentComponent.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nullable
public static LightweightHint showEditorFragmentHint(Editor editor, TextRange range, boolean showFolding, boolean hideByAnyKey) {
  if (!(editor instanceof EditorEx)) return null;
  JRootPane rootPane = editor.getComponent().getRootPane();
  if (rootPane == null) return null;
  JLayeredPane layeredPane = rootPane.getLayeredPane();
  int lineHeight = editor.getLineHeight();
  int overhang = editor.getScrollingModel().getVisibleArea().y - editor.logicalPositionToXY(editor.offsetToLogicalPosition(range.getEndOffset())).y;
  int yRelative = overhang > 0 && overhang < lineHeight ? lineHeight - overhang + JBUIScale.scale(LINE_BORDER_THICKNESS + EMPTY_BORDER_THICKNESS) : 0;
  Point point = SwingUtilities.convertPoint(((EditorEx)editor).getScrollPane().getViewport(), -2, yRelative, layeredPane);
  return showEditorFragmentHintAt(editor, range, point.y, true, showFolding, hideByAnyKey, true, false);
}
 
Example 9
Source File: DiffEmptyHighlighterRenderer.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public void paint(@Nonnull Editor editor, @Nonnull RangeHighlighter highlighter, @Nonnull Graphics g) {
  g.setColor(myDiffType.getColor(editor));
  Point point = editor.logicalPositionToXY(editor.offsetToLogicalPosition(highlighter.getStartOffset()));
  int endy = point.y + editor.getLineHeight() - 1;
  g.drawLine(point.x, point.y, point.x, endy);
  g.drawLine(point.x - 1, point.y, point.x - 1, endy);
}
 
Example 10
Source File: DiffDrawUtil.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nonnull
private static LineMarkerRenderer createFoldingGutterLineRenderer(@Nonnull final TextDiffType type,
                                                                  @Nonnull final SeparatorPlacement placement,
                                                                  final boolean doubleLine,
                                                                  final boolean resolved) {
  return new LineMarkerRendererEx() {
    @Override
    public void paint(Editor editor, Graphics g, Rectangle r) {
      EditorGutterComponentEx gutter = ((EditorEx)editor).getGutterComponentEx();
      Graphics2D g2 = (Graphics2D)g;

      int x1 = gutter.getWhitespaceSeparatorOffset();
      int x2 = gutter.getWidth();

      int y = r.y;
      if (placement == SeparatorPlacement.BOTTOM) y += editor.getLineHeight();

      drawChunkBorderLine(g2, x1, x2, y - 1, type.getColor(editor), doubleLine, resolved);
    }

    @Nonnull
    @Override
    public Position getPosition() {
      return Position.CUSTOM;
    }
  };
}
 
Example 11
Source File: SyncScrollSupport.java    From consulo with Apache License 2.0 5 votes vote down vote up
private static void syncVerticalScroll(@Nonnull ScrollingContext context,
                                       @Nonnull Rectangle newRectangle,
                                       @Nonnull Rectangle oldRectangle) {
  if (newRectangle.y == oldRectangle.y) return;
  EditingSides sidesContainer = context.getSidesContainer();
  FragmentSide masterSide = context.getMasterSide();
  FragmentSide masterDiffSide = context.getMasterDiffSide();

  Editor master = sidesContainer.getEditor(masterSide);
  Editor slave = sidesContainer.getEditor(masterSide.otherSide());

  if (master == null || slave == null) return;

  int masterVerticalScrollOffset = master.getScrollingModel().getVerticalScrollOffset();
  int slaveVerticalScrollOffset = slave.getScrollingModel().getVerticalScrollOffset();

  Rectangle viewRect = master.getScrollingModel().getVisibleArea();
  int middleY = viewRect.height / 3;

  if (master.getDocument().getTextLength() == 0) return;

  LogicalPosition masterPos = master.xyToLogicalPosition(new Point(viewRect.x, masterVerticalScrollOffset + middleY));
  int masterCenterLine = masterPos.line;
  int scrollToLine = sidesContainer.getLineBlocks().transform(masterDiffSide, masterCenterLine);

  int offset;
  if (scrollToLine < 0) {
    offset = slaveVerticalScrollOffset + newRectangle.y - oldRectangle.y;
  }
  else {
    int correction = (masterVerticalScrollOffset + middleY) % master.getLineHeight();
    Point point = slave.logicalPositionToXY(new LogicalPosition(scrollToLine, masterPos.column));
    offset = point.y - middleY + correction;
  }

  int deltaHeaderOffset = getHeaderOffset(slave) - getHeaderOffset(master);
  doScrollVertically(slave.getScrollingModel(), offset + deltaHeaderOffset);
}
 
Example 12
Source File: DiffDrawUtil.java    From consulo with Apache License 2.0 5 votes vote down vote up
public static int lineToY(@Nonnull Editor editor, int line) {
  Document document = editor.getDocument();
  if (line >= getLineCount(document)) {
    int y = lineToY(editor, getLineCount(document) - 1);
    return y + editor.getLineHeight() * (line - getLineCount(document) + 1);
  }
  return editor.logicalPositionToXY(editor.offsetToLogicalPosition(document.getLineStartOffset(line))).y;
}
 
Example 13
Source File: BasicEditorTextFieldUI.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public Dimension getMinimumSize(JComponent c) {
  EditorTextField editorTextField = (EditorTextField)c;
  Editor editor = editorTextField.getEditor();
  Dimension size = new Dimension(1, 20);
  if (editor != null) {
    size.height = editor.getLineHeight();

    JBInsets.addTo(size, editorTextField.getInsets());
    JBInsets.addTo(size, editor.getInsets());
  }

  return size;
}
 
Example 14
Source File: BraceHighlightingHandler.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public void paint(Editor editor, Graphics g, Rectangle r) {
  int height = r.height + editor.getLineHeight();
  g.setColor(myColor);
  g.fillRect(r.x, r.y, THICKNESS, height);
  g.fillRect(r.x + THICKNESS, r.y, DEEPNESS, THICKNESS);
  g.fillRect(r.x + THICKNESS, r.y + height - THICKNESS, DEEPNESS, THICKNESS);
}
 
Example 15
Source File: DaemonTooltipUtil.java    From consulo with Apache License 2.0 5 votes vote down vote up
static void showInfoTooltip(@Nonnull final HighlightInfo info, @Nonnull Editor editor, final int defaultOffset, final int currentWidth, final boolean requestFocus, final boolean showImmediately) {
  if (Registry.is("editor.new.mouse.hover.popups")) {
    EditorMouseHoverPopupManager.getInstance().showInfoTooltip(editor, info, defaultOffset, requestFocus, showImmediately);
    return;
  }
  String text = info.getToolTip();
  if (text == null) return;
  Rectangle visibleArea = editor.getScrollingModel().getVisibleArea();

  Point point = editor.logicalPositionToXY(editor.offsetToLogicalPosition(defaultOffset));
  Point highlightEndPoint = editor.logicalPositionToXY(editor.offsetToLogicalPosition(info.endOffset));
  if (highlightEndPoint.y > point.y) {
    if (highlightEndPoint.x > point.x) {
      point = new Point(point.x, highlightEndPoint.y);
    }
    else if (highlightEndPoint.y > point.y + editor.getLineHeight()) {
      point = new Point(point.x, highlightEndPoint.y - editor.getLineHeight());
    }
  }

  Point bestPoint = new Point(point);
  bestPoint.y += editor.getLineHeight() / 2;
  if (!visibleArea.contains(bestPoint)) bestPoint = point;

  Point p = SwingUtilities.convertPoint(editor.getContentComponent(), bestPoint, editor.getComponent().getRootPane().getLayeredPane());

  HintHint hintHint = new HintHint(editor, bestPoint).setAwtTooltip(true).setHighlighterType(true).setRequestFocus(requestFocus).setCalloutShift(editor.getLineHeight() / 2 - 1)
          .setShowImmediately(showImmediately);

  TooltipAction action = TooltipActionProvider.calcTooltipAction(info, editor);
  ErrorStripTooltipRendererProvider provider = ((EditorMarkupModel)editor.getMarkupModel()).getErrorStripTooltipRendererProvider();
  TooltipRenderer tooltipRenderer = provider.calcTooltipRenderer(text, action, currentWidth);

  TooltipController.getInstance().showTooltip(editor, p, tooltipRenderer, false, DAEMON_INFO_GROUP, hintHint);
}
 
Example 16
Source File: DividerPolygon.java    From consulo with Apache License 2.0 4 votes vote down vote up
static Interval getVisibleInterval(Editor editor) {
  int offset = editor.getScrollingModel().getVerticalScrollOffset();
  LogicalPosition logicalPosition = editor.xyToLogicalPosition(new Point(0, offset));
  int line = logicalPosition.line;
  return new Interval(line, editor.getComponent().getHeight() / editor.getLineHeight() + 1);
}
 
Example 17
Source File: QuickDocOnMouseOverManager.java    From consulo with Apache License 2.0 4 votes vote down vote up
private void processMouseMove(@Nonnull EditorMouseEvent e) {
  if (!myApplicationActive || !myEnabled || e.getArea() != EditorMouseEventArea.EDITING_AREA) {
    // Skip if the mouse is not at the editing area.
    closeQuickDocIfPossible();
    return;
  }

  if (e.getMouseEvent().getModifiers() != 0) {
    // Don't show the control when any modifier is active (e.g. Ctrl or Alt is hold). There is a common situation that a user
    // wants to navigate via Ctrl+click or perform quick evaluate by Alt+click.
    return;
  }

  Editor editor = e.getEditor();
  if (EditorMouseHoverPopupControl.arePopupsDisabled(editor)) {
    return;
  }

  if (editor.isOneLineMode()) {
    // Don't want auto quick doc to mess at, say, editor used for debugger condition.
    return;
  }

  Project project = editor.getProject();
  if (project == null) {
    return;
  }

  DocumentationManager documentationManager = DocumentationManager.getInstance(project);
  JBPopup hint = documentationManager.getDocInfoHint();
  if (hint != null) {

    // Skip the event if the control is shown because of explicit 'show quick doc' action call.
    DocumentationManager manager = getDocManager();
    if (manager == null || !manager.isCloseOnSneeze()) {
      return;
    }

    // Skip the event if the mouse is under the opened quick doc control.
    Point hintLocation = hint.getLocationOnScreen();
    Dimension hintSize = hint.getSize();
    int mouseX = e.getMouseEvent().getXOnScreen();
    int mouseY = e.getMouseEvent().getYOnScreen();
    int resizeZoneWidth = editor.getLineHeight();
    if (mouseX >= hintLocation.x - resizeZoneWidth && mouseX <= hintLocation.x + hintSize.width + resizeZoneWidth &&
        mouseY >= hintLocation.y - resizeZoneWidth && mouseY <= hintLocation.y + hintSize.height + resizeZoneWidth) {
      return;
    }
  }

  PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
  if (psiFile == null) {
    closeQuickDocIfPossible();
    return;
  }

  Point point = e.getMouseEvent().getPoint();
  if (editor instanceof EditorEx && ((EditorEx)editor).getFoldingModel().getFoldingPlaceholderAt(point) != null) {
    closeQuickDocIfPossible();
    return;
  }

  VisualPosition visualPosition = editor.xyToVisualPosition(point);
  if (editor.getSoftWrapModel().isInsideOrBeforeSoftWrap(visualPosition)) {
    closeQuickDocIfPossible();
    return;
  }

  int mouseOffset = editor.logicalPositionToOffset(editor.visualToLogicalPosition(visualPosition));
  PsiElement elementUnderMouse = psiFile.findElementAt(mouseOffset);
  if (elementUnderMouse == null || elementUnderMouse instanceof PsiWhiteSpace || elementUnderMouse instanceof PsiPlainText) {
    closeQuickDocIfPossible();
    return;
  }

  if (elementUnderMouse.equals(SoftReference.dereference(myActiveElements.get(editor))) && (!myAlarm.isEmpty() // Request to show documentation for the target component has been already queued.
                                                                                            || hint != null)) // Documentation for the target component is being shown.
  {
    return;
  }
  allowUpdateFromContext(project, false);
  closeQuickDocIfPossible();
  myActiveElements.put(editor, new WeakReference<>(elementUnderMouse));

  myAlarm.cancelAllRequests();
  if (myCurrentRequest != null) myCurrentRequest.cancel();
  myCurrentRequest = new MyShowQuickDocRequest(documentationManager, editor, mouseOffset, elementUnderMouse);
  myAlarm.addRequest(myCurrentRequest, EditorSettingsExternalizable.getInstance().getTooltipsDelay());
}
 
Example 18
Source File: LookupUi.java    From consulo with Apache License 2.0 4 votes vote down vote up
Rectangle calculatePosition() {
  final JComponent lookupComponent = myLookup.getComponent();
  Dimension dim = lookupComponent.getPreferredSize();
  int lookupStart = myLookup.getLookupStart();
  Editor editor = myLookup.getTopLevelEditor();
  if (lookupStart < 0 || lookupStart > editor.getDocument().getTextLength()) {
    LOG.error(lookupStart + "; offset=" + editor.getCaretModel().getOffset() + "; element=" + myLookup.getPsiElement());
  }

  LogicalPosition pos = editor.offsetToLogicalPosition(lookupStart);
  Point location = editor.logicalPositionToXY(pos);
  location.y += editor.getLineHeight();
  location.x -= myLookup.myCellRenderer.getTextIndent();
  // extra check for other borders
  final Window window = UIUtil.getWindow(lookupComponent);
  if (window != null) {
    final Point point = SwingUtilities.convertPoint(lookupComponent, 0, 0, window);
    location.x -= point.x;
  }

  SwingUtilities.convertPointToScreen(location, editor.getContentComponent());
  final Rectangle screenRectangle = ScreenUtil.getScreenRectangle(editor.getContentComponent());

  if (!isPositionedAboveCaret()) {
    int shiftLow = screenRectangle.y + screenRectangle.height - (location.y + dim.height);
    myPositionedAbove = shiftLow < 0 && shiftLow < location.y - dim.height && location.y >= dim.height;
  }
  if (isPositionedAboveCaret()) {
    location.y -= dim.height + editor.getLineHeight();
    if (pos.line == 0) {
      location.y += 1;
      //otherwise the lookup won't intersect with the editor and every editor's resize (e.g. after typing in console) will close the lookup
    }
  }

  if (!screenRectangle.contains(location)) {
    location = ScreenUtil.findNearestPointOnBorder(screenRectangle, location);
  }

  Rectangle candidate = new Rectangle(location, dim);
  ScreenUtil.cropRectangleToFitTheScreen(candidate);

  JRootPane rootPane = editor.getComponent().getRootPane();
  if (rootPane != null) {
    SwingUtilities.convertPointFromScreen(location, rootPane.getLayeredPane());
  }
  else {
    LOG.error("editor.disposed=" + editor.isDisposed() + "; lookup.disposed=" + myLookup.isLookupDisposed() + "; editorShowing=" + editor.getContentComponent().isShowing());
  }

  myMaximumHeight = candidate.height;
  return new Rectangle(location.x, location.y, dim.width, candidate.height);
}
 
Example 19
Source File: QuickEditAction.java    From consulo with Apache License 2.0 4 votes vote down vote up
public static Balloon.Position getBalloonPosition(Editor editor) {
  final int line = editor.getCaretModel().getVisualPosition().line;
  final Rectangle area = editor.getScrollingModel().getVisibleArea();
  int startLine  = area.y / editor.getLineHeight() + 1;
  return (line - startLine) * editor.getLineHeight() < 200 ? Balloon.Position.below : Balloon.Position.above;
}
 
Example 20
Source File: IntentionHintComponent.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nullable
private static Point getHintPosition(Editor editor) {
  if (ApplicationManager.getApplication().isUnitTestMode()) return new Point();
  final int offset = editor.getCaretModel().getOffset();
  final VisualPosition pos = editor.offsetToVisualPosition(offset);
  int line = pos.line;

  final Point position = editor.visualPositionToXY(new VisualPosition(line, 0));
  LOG.assertTrue(editor.getComponent().isDisplayable());

  JComponent convertComponent = editor.getContentComponent();

  Point realPoint;
  final boolean oneLineEditor = editor.isOneLineMode();
  if (oneLineEditor) {
    // place bulb at the corner of the surrounding component
    final JComponent contentComponent = editor.getContentComponent();
    Container ancestorOfClass = SwingUtilities.getAncestorOfClass(JComboBox.class, contentComponent);

    if (ancestorOfClass != null) {
      convertComponent = (JComponent)ancestorOfClass;
    }
    else {
      ancestorOfClass = SwingUtilities.getAncestorOfClass(JTextField.class, contentComponent);
      if (ancestorOfClass != null) {
        convertComponent = (JComponent)ancestorOfClass;
      }
    }

    realPoint = new Point(-(AllIcons.Actions.RealIntentionBulb.getIconWidth() / 2) - 4, -(AllIcons.Actions.RealIntentionBulb.getIconHeight() / 2));
  }
  else {
    Rectangle visibleArea = editor.getScrollingModel().getVisibleArea();
    if (position.y < visibleArea.y || position.y >= visibleArea.y + visibleArea.height) return null;

    // try to place bulb on the same line
    int yShift = -(NORMAL_BORDER_SIZE + AllIcons.Actions.RealIntentionBulb.getIconHeight());
    if (canPlaceBulbOnTheSameLine(editor)) {
      yShift = -(NORMAL_BORDER_SIZE + (AllIcons.Actions.RealIntentionBulb.getIconHeight() - editor.getLineHeight()) / 2 + 3);
    }
    else if (position.y < visibleArea.y + editor.getLineHeight()) {
      yShift = editor.getLineHeight() - NORMAL_BORDER_SIZE;
    }

    final int xShift = AllIcons.Actions.RealIntentionBulb.getIconWidth();

    realPoint = new Point(Math.max(0, visibleArea.x - xShift), position.y + yShift);
  }

  Point location = SwingUtilities.convertPoint(convertComponent, realPoint, editor.getComponent().getRootPane().getLayeredPane());
  return new Point(location.x, location.y);
}