Delegate get/setFirstVisibleScreenColumn from the model to the component

This commit is contained in:
Nathan Sobo
2017-04-18 16:49:22 -06:00
committed by Antonio Scandurra
parent 4f52637518
commit eb7cdf2a34
3 changed files with 26 additions and 2 deletions

View File

@@ -2325,6 +2325,14 @@ class TextEditorComponent {
)
}
getFirstVisibleColumn () {
return Math.floor(this.getScrollLeft() / this.getBaseCharacterWidth())
}
setFirstVisibleColumn (column) {
this.setScrollLeft(column * this.getBaseCharacterWidth())
}
getVisibleTileCount () {
return Math.floor((this.getLastVisibleRow() - this.getFirstVisibleRow()) / this.getRowsPerTile()) + 2
}