fix formatting
This commit is contained in:
parent
98556ccd10
commit
0099165a85
1 changed files with 12 additions and 12 deletions
|
|
@ -634,17 +634,17 @@ var VirtualRenderer = function(container, theme) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.scrollToLine = function(line, center) {
|
this.scrollToLine = function(line, center) {
|
||||||
var lineHeight = { lineHeight: this.lineHeight };
|
var lineHeight = { lineHeight: this.lineHeight };
|
||||||
var offset = 0;
|
var offset = 0;
|
||||||
for (var l = 1; l < line; l++) {
|
for (var l = 1; l < line; l++) {
|
||||||
offset += this.session.getRowHeight(lineHeight, l-1);
|
offset += this.session.getRowHeight(lineHeight, l-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (center) {
|
if (center) {
|
||||||
offset -= this.$size.scrollerHeight / 2;
|
offset -= this.$size.scrollerHeight / 2;
|
||||||
}
|
}
|
||||||
this.scrollToY(offset);
|
this.scrollToY(offset);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.scrollToY = function(scrollTop) {
|
this.scrollToY = function(scrollTop) {
|
||||||
var maxHeight = this.session.getScreenLength() * this.lineHeight - this.$size.scrollerHeight;
|
var maxHeight = this.session.getScreenLength() * this.lineHeight - this.$size.scrollerHeight;
|
||||||
|
|
@ -777,4 +777,4 @@ var VirtualRenderer = function(container, theme) {
|
||||||
}).call(VirtualRenderer.prototype);
|
}).call(VirtualRenderer.prototype);
|
||||||
|
|
||||||
exports.VirtualRenderer = VirtualRenderer;
|
exports.VirtualRenderer = VirtualRenderer;
|
||||||
});
|
});
|
||||||
Loading…
Add table
Add a link
Reference in a new issue