add scrollTo method

This commit is contained in:
nightwing 2013-08-26 18:09:31 +04:00
commit 2cef7f4747

View file

@ -1292,12 +1292,20 @@ var VirtualRenderer = function(container, theme) {
this.$loop.schedule(this.CHANGE_H_SCROLL);
};
/**
* Scrolls the editor across both x- and y-axes.
* @param {Number} x The x value to scroll to
* @param {Number} y The y value to scroll to
**/
this.scrollTo = function(x, y) {
this.session.setScrollTop(y);
this.session.setScrollLeft(y);
};
/**
* Scrolls the editor across both x- and y-axes.
* @param {Number} deltaX The x value to scroll by
* @param {Number} deltaY The y value to scroll by
*
*
**/
this.scrollBy = function(deltaX, deltaY) {
deltaY && this.session.setScrollTop(this.session.getScrollTop() + deltaY);