# VirtualRenderer

The class that is responsible for drawing everything you see on the screen!

### Constructors

- - new VirtualRenderer(DOMElement container, String theme)

Constructs a new `VirtualRenderer` within the `container` specified, applying the given `theme`.

Constructs a new `VirtualRenderer` within the `container` specified, applying the given `theme`.

#### Arguments

container | DOMElement | Required. The root element of the editor
theme | String | Required. The starting theme

### Methods

- - VirtualRenderer._loadTheme()
  - Undocumented

- - VirtualRenderer.addGutterDecoration(Object row, Object className)

Deprecated; (moved to `EditSession`)

Deprecated; (moved to `EditSession`)

#### Arguments

row | Object | Required.
className | Object | Required.

- - VirtualRenderer.adjustWrapLimit()

Adjusts the wrap limit, which is the number of characters that can fit within the width of the edit area on screen.

Adjusts the wrap limit, which is the number of characters that can fit within the width of the edit area on screen.

- - VirtualRenderer.alignCursor()
  - Undocumented

- - VirtualRenderer.animateScrolling()
  - Undocumented

- - VirtualRenderer.destroy()

Destroys the text and cursor layers for this renderer.

Destroys the text and cursor layers for this renderer.

- - VirtualRenderer.getAnimatedScroll()
  - - Boolean

Returns whether an animated scroll happens or not.

Returns whether an animated scroll happens or not.

- - VirtualRenderer.getContainerElement()
  - - DOMElement

Returns the root element containing this renderer.

Returns the root element containing this renderer.

- - VirtualRenderer.getDisplayIndentGuides()
  - Undocumented

- - VirtualRenderer.getFadeFoldWidgets()
  - Undocumented

- - VirtualRenderer.getFirstFullyVisibleRow()
  - - Number

Returns the index of the first fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.

Returns the index of the first fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.

- - VirtualRenderer.getFirstVisibleRow()
  - - Number

Returns the index of the first visible row.

Returns the index of the first visible row.

- - VirtualRenderer.getHighlightGutterLine()
  - Undocumented

- - VirtualRenderer.getHScrollBarAlwaysVisible()
  - - Boolean

Returns whether the horizontal scrollbar is set to be always visible.

Returns whether the horizontal scrollbar is set to be always visible.

- - VirtualRenderer.getLastFullyVisibleRow()
  - - Number

Returns the index of the last fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.

Returns the index of the last fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.

- - VirtualRenderer.getLastVisibleRow()
  - - Number

Returns the index of the last visible row.

Returns the index of the last visible row.

- - VirtualRenderer.getMouseEventTarget()
  - - DOMElement

Returns the element that the mouse events are attached to

Returns the element that the mouse events are attached to

- - VirtualRenderer.getPrintMarginColumn()
  - - Boolean

Returns whether the print margin column is being shown or not.

Returns whether the print margin column is being shown or not.

- - VirtualRenderer.getScrollBottomRow()
  - - Number

Returns the last visible row, regardless of whether it's fully visible or not.

Returns the last visible row, regardless of whether it's fully visible or not.

- - VirtualRenderer.getScrollLeft()
  - - Number

Returns the value of the distance between the left of the editor and the leftmost part of the visible content.

Returns the value of the distance between the left of the editor and the leftmost part of the visible content.

- - VirtualRenderer.getScrollTop()
  - - Number

Returns the value of the distance between the top of the editor and the topmost part of the visible content.

Returns the value of the distance between the top of the editor and the topmost part of the visible content.

- - VirtualRenderer.getScrollTopRow()
  - - Number

Returns the first visible row, regardless of whether it's fully visible or not.

Returns the first visible row, regardless of whether it's fully visible or not.

- - VirtualRenderer.getShowGutter()
  - - Boolean

Returns `true` if the gutter is being shown.

Returns `true` if the gutter is being shown.

- - VirtualRenderer.getShowInvisibles()
  - - Boolean

Returns whether invisible characters are being shown or not.

Returns whether invisible characters are being shown or not.

- - VirtualRenderer.getShowPrintMargin()
  - - Boolean

Returns whether the print margin is being shown or not.

Returns whether the print margin is being shown or not.

- - VirtualRenderer.getTextAreaContainer()
  - - DOMElement

Returns the element to which the hidden text area is added.

Returns the element to which the hidden text area is added.

- - VirtualRenderer.getTheme()
  - - String

Returns the path of the current theme.

Returns the path of the current theme.

- - VirtualRenderer.hideComposition()

Hides the current composition.

Hides the current composition.

- - VirtualRenderer.hideCursor()

Hides the cursor icon.

Hides the cursor icon.

- - VirtualRenderer.isScrollableBy(Number deltaX, Number deltaY)
  - - Boolean

Returns `true` if you can still scroll by either parameter; in other words, you haven't reached the end of the file or line.

Returns `true` if you can still scroll by either parameter; in other words, you haven't reached the end of the file or line.

#### Arguments

deltaX | Number | Required. The x value to scroll by
deltaY | Number | Required. The y value to scroll by

- - VirtualRenderer.onChangeTabSize()
  - Undocumented

- - VirtualRenderer.onGutterResize()
  - Undocumented

- - VirtualRenderer.onResize(Boolean force, Number gutterWidth, Number width, Number height)

Triggers a resize of the editor.

Triggers a resize of the editor.

#### Arguments

force | Boolean | Required. If `true`, recomputes the size, even if the height and width haven't changed
gutterWidth | Number | Required. The width of the gutter in pixels
width | Number | Required. The width of the editor in pixels
height | Number | Required. The hiehgt of the editor, in pixels

- - VirtualRenderer.pixelToScreenCoordinates()
  - Undocumented

- - VirtualRenderer.removeGutterDecoration(Object row, Object className)

Deprecated; (moved to `EditSession`)

Deprecated; (moved to `EditSession`)

#### Arguments

row | Object | Required.
className | Object | Required.

- - VirtualRenderer.screenToTextCoordinates()
  - Undocumented

- - VirtualRenderer.scrollBy(Number deltaX, Number deltaY)

Scrolls the editor across both x- and y-axes.

Scrolls the editor across both x- and y-axes.

#### Arguments

deltaX | Number | Required. The x value to scroll by
deltaY | Number | Required. The y value to scroll by

- - VirtualRenderer.scrollCursorIntoView(Object cursor, Object offset)

Scrolls the cursor into the first visibile area of the editor

Scrolls the cursor into the first visibile area of the editor

#### Arguments

cursor | Object | Required.
offset | Object | Required.

- - VirtualRenderer.scrollSelectionIntoView()
  - Undocumented

- - VirtualRenderer.scrollToLine(Number line, Boolean center, Boolean animate, Function callback)

Gracefully scrolls the editor to the row indicated.

Gracefully scrolls the editor to the row indicated.

#### Arguments

line | Number | Required. A line number
center | Boolean | Required. If `true`, centers the editor the to indicated line
animate | Boolean | Required. If `true` animates scrolling
callback | Function | Required. Function to be called after the animation has finished

- - VirtualRenderer.scrollToRow(Number row)

Gracefully scrolls from the top of the editor to the row indicated.

Gracefully scrolls from the top of the editor to the row indicated.

#### Arguments

row | Number | Required. A row id

- - VirtualRenderer.scrollToX(Number scrollLeft)
  - - Number

Scrolls the editor across the x-axis to the pixel indicated.

Scrolls the editor across the x-axis to the pixel indicated.

#### Arguments

scrollLeft | Number | Required. The position to scroll to

- - VirtualRenderer.scrollToY(Number scrollTop)
  - - Number

Scrolls the editor to the y pixel indicated.

Scrolls the editor to the y pixel indicated.

#### Arguments

scrollTop | Number | Required. The position to scroll to

- - VirtualRenderer.setAnimatedScroll(Boolean shouldAnimate)

Identifies whether you want to have an animated scroll or not.

Identifies whether you want to have an animated scroll or not.

#### Arguments

shouldAnimate | Boolean | Required. Set to `true` to show animated scrolls

- - VirtualRenderer.setAnnotations(Array annotations)

Sets annotations for the gutter.

Sets annotations for the gutter.

#### Arguments

annotations | Array | Required. An array containing annotations

- - VirtualRenderer.setCompositionText(String text)
  - Undocumented

#### Arguments

text | String | Required. A string of text to use Sets the inner text of the current composition to `text`.

- - VirtualRenderer.setDisplayIndentGuides()
  - Undocumented

- - VirtualRenderer.setFadeFoldWidgets()
  - Undocumented

- - VirtualRenderer.setHighlightGutterLine()
  - Undocumented

- - VirtualRenderer.setHScrollBarAlwaysVisible(Boolean alwaysVisible)

Identifies whether you want to show the horizontal scrollbar or not.

Identifies whether you want to show the horizontal scrollbar or not.

#### Arguments

alwaysVisible | Boolean | Required. Set to `true` to make the horizontal scroll bar visible

- - VirtualRenderer.setPadding(Number padding)

Sets the padding for all the layers.

Sets the padding for all the layers.

#### Arguments

padding | Number | Required. A new padding value (in pixels)

- - VirtualRenderer.setPrintMarginColumn(Boolean showPrintMargin)

Identifies whether you want to show the print margin column or not.

Identifies whether you want to show the print margin column or not.

#### Arguments

showPrintMargin | Boolean | Required. Set to `true` to show the print margin column

- - VirtualRenderer.setSession(Object session)

Associates the renderer with an `EditSession`.

Associates the renderer with an `EditSession`.

#### Arguments

session | Object | Required.

- - VirtualRenderer.setShowGutter(Boolean show)

Identifies whether you want to show the gutter or not.

Identifies whether you want to show the gutter or not.

#### Arguments

show | Boolean | Required. Set to `true` to show the gutter

- - VirtualRenderer.setShowInvisibles(Boolean showInvisibles)

Identifies whether you want to show invisible characters or not.

Identifies whether you want to show invisible characters or not.

#### Arguments

showInvisibles | Boolean | Required. Set to `true` to show invisibles

- - VirtualRenderer.setShowPrintMargin(Boolean showPrintMargin)

Identifies whether you want to show the print margin or not.

Identifies whether you want to show the print margin or not.

#### Arguments

showPrintMargin | Boolean | Required. Set to `true` to show the print margin

- - VirtualRenderer.setStyle()
  - Undocumented

- - VirtualRenderer.setTheme(String theme)

Sets a new theme for the editor. `theme` should exist, and be a directory path, like `ace/theme/textmate`.

Sets a new theme for the editor. `theme` should exist, and be a directory path, like `ace/theme/textmate`.

#### Arguments

theme | String | Required. The path to a theme

- - VirtualRenderer.showCursor()

Shows the cursor icon.

Shows the cursor icon.

- - VirtualRenderer.textToScreenCoordinates(Number row, Number column)
  - - Object

Returns an object containing the `pageX` and `pageY` coordinates of the document position.

Returns an object containing the `pageX` and `pageY` coordinates of the document position.

#### Arguments

row | Number | Required. The document row position
column | Number | Required. The document column position

- - VirtualRenderer.unsetStyle(String style)

Removes the class `style` from the editor.

Removes the class `style` from the editor.

#### Arguments

style | String | Required. A class name

- - VirtualRenderer.updateBackMarkers()

Schedules an update to all the back markers in the document.

Schedules an update to all the back markers in the document.

- - VirtualRenderer.updateBreakpoints(Object rows)

Redraw breakpoints.

Redraw breakpoints.

#### Arguments

rows | Object | Required.

- - VirtualRenderer.updateCharacterSize()
  - Undocumented

- - VirtualRenderer.updateCursor()

Updates the cursor icon.

Updates the cursor icon.

- - VirtualRenderer.updateFontSize()

Updates the font size.

Updates the font size.

- - VirtualRenderer.updateFrontMarkers()

Schedules an update to all the front markers in the document.

Schedules an update to all the front markers in the document.

- - VirtualRenderer.updateFull(Boolean force)

Triggers a full update of all the layers, for all the rows.

Triggers a full update of all the layers, for all the rows.

#### Arguments

force | Boolean | Required. If `true`, forces the changes through

- - VirtualRenderer.updateLines(Number firstRow, Number lastRow)

Triggers a partial update of the text, from the range given by the two parameters.

Triggers a partial update of the text, from the range given by the two parameters.

#### Arguments

firstRow | Number | Required. The first row to update
lastRow | Number | Required. The last row to update

- - VirtualRenderer.updateText()

Triggers a full update of the text, for all the rows.

Triggers a full update of the text, for all the rows.

- - VirtualRenderer.visualizeBlur()

Blurs the current container.

Blurs the current container.

- - VirtualRenderer.visualizeFocus()

Focuses the current container.

Focuses the current container.