fix scroll to Y
This commit is contained in:
parent
d14c7e6a58
commit
4c865950ed
1 changed files with 4 additions and 3 deletions
|
|
@ -298,7 +298,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$updateScrollBar = function() {
|
this.$updateScrollBar = function() {
|
||||||
this.scrollBar.setInnerHeight(this.doc.getLength() * this.lineHeight + this.$padding * 2);
|
this.scrollBar.setInnerHeight(this.doc.getLength() * this.lineHeight + this.$padding);
|
||||||
this.scrollBar.setScrollTop(this.scrollTop);
|
this.scrollBar.setScrollTop(this.scrollTop);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -523,10 +523,11 @@ var VirtualRenderer = function(container, theme) {
|
||||||
|
|
||||||
this.scrollToY = function(scrollTop) {
|
this.scrollToY = function(scrollTop) {
|
||||||
var maxHeight = this.lines.length * this.lineHeight - this.$size.scrollerHeight + this.$padding;
|
var maxHeight = this.lines.length * this.lineHeight - this.$size.scrollerHeight + this.$padding;
|
||||||
var scrollTop = Math.max(0, Math.min(maxHeight, scrollTop));
|
|
||||||
if (scrollTop >= maxHeight - this.$padding)
|
if (scrollTop >= maxHeight - this.$padding)
|
||||||
scrollTop = maxHeight;
|
scrollTop = maxHeight;
|
||||||
|
|
||||||
|
var scrollTop = Math.max(0, Math.min(maxHeight, scrollTop));
|
||||||
|
|
||||||
if (this.scrollTop !== scrollTop) {
|
if (this.scrollTop !== scrollTop) {
|
||||||
this.scrollTop = scrollTop;
|
this.scrollTop = scrollTop;
|
||||||
this.$loop.schedule(this.CHANGE_SCROLL);
|
this.$loop.schedule(this.CHANGE_SCROLL);
|
||||||
|
|
@ -536,7 +537,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
this.scrollToX = function(scrollLeft) {
|
this.scrollToX = function(scrollLeft) {
|
||||||
if (scrollLeft <= this.$padding)
|
if (scrollLeft <= this.$padding)
|
||||||
scrollLeft = 0;
|
scrollLeft = 0;
|
||||||
|
|
||||||
this.scroller.scrollLeft = scrollLeft;
|
this.scroller.scrollLeft = scrollLeft;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue