fix #1827 setScrollMargin Breaks Multiple Selection When Margin is Greater Than 0

This commit is contained in:
nightwing 2014-02-23 12:02:45 +04:00
commit 07c7c86944
2 changed files with 3 additions and 3 deletions

View file

@ -190,7 +190,7 @@ var Cursor = function(parentEl) {
for (var i = 0, n = selections.length; i < n; i++) {
var pixelPos = this.getPixelPosition(selections[i].cursor, true);
if ((pixelPos.top > config.height + config.offset ||
pixelPos.top < -config.offset) && i > 1) {
pixelPos.top < 0) && i > 1) {
continue;
}

View file

@ -720,7 +720,7 @@ var VirtualRenderer = function(container, theme) {
sm.v = sm.top + sm.bottom;
sm.h = sm.left + sm.right;
if (sm.top && this.scrollTop <= 0 && this.session)
this.session.setScrollTop(sm.top);
this.session.setScrollTop(-sm.top);
this.updateFull();
};
@ -1002,7 +1002,7 @@ var VirtualRenderer = function(container, theme) {
minHeight : minHeight,
maxHeight : maxHeight,
offset : offset,
gutterOffset : Math.ceil((offset + size.height - size.scrollerHeight) / lineHeight),
gutterOffset : Math.max(0, Math.ceil((offset + size.height - size.scrollerHeight) / lineHeight)),
height : this.$size.scrollerHeight
};