add alignCursor to virtual_renderer

This commit is contained in:
nightwing 2012-04-22 12:55:53 +04:00
commit 0c7b310ecc

View file

@ -1011,6 +1011,16 @@ var VirtualRenderer = function(container, theme) {
this.session.setScrollTop(row * this.lineHeight);
};
this.alignCursor = function(cursor, alignment) {
if (typeof cursor == "number")
cursor = {row: cursor, column: 0};
var pos = this.$cursorLayer.getPixelPosition(cursor);
var offset = pos.top - this.$size.scrollerHeight * (alignment || 0);
this.session.setScrollTop(offset);
};
this.STEPS = 8;
this.$calcSteps = function(fromValue, toValue){
var i = 0;