remove top padding
This commit is contained in:
parent
3e28057caf
commit
3c2bd0f76e
1 changed files with 4 additions and 6 deletions
|
|
@ -369,7 +369,7 @@ var VirtualRenderer = function(container, theme) {
|
|||
};
|
||||
|
||||
this.$computeLayerConfig = function() {
|
||||
var offset = (this.scrollTop % this.lineHeight) - this.$padding;
|
||||
var offset = this.scrollTop % this.lineHeight;
|
||||
var minHeight = this.$size.scrollerHeight + this.lineHeight;
|
||||
|
||||
var longestLine = this.$getLongestLine();
|
||||
|
|
@ -481,7 +481,7 @@ var VirtualRenderer = function(container, theme) {
|
|||
var pos = this.$cursorLayer.getPixelPosition();
|
||||
|
||||
var left = pos.left + this.$padding;
|
||||
var top = pos.top + this.$padding;
|
||||
var top = pos.top;
|
||||
|
||||
if (this.getScrollTop() > top) {
|
||||
this.scrollToY(top);
|
||||
|
|
@ -520,12 +520,10 @@ var VirtualRenderer = function(container, theme) {
|
|||
};
|
||||
|
||||
this.scrollToY = function(scrollTop) {
|
||||
var maxHeight = this.lines.length * this.lineHeight - this.$size.scrollerHeight + this.$padding * 2;
|
||||
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)
|
||||
scrollTop = maxHeight;
|
||||
else if (scrollTop <= this.$padding)
|
||||
scrollTop = 0;
|
||||
|
||||
if (this.scrollTop !== scrollTop) {
|
||||
this.scrollTop = scrollTop;
|
||||
|
|
@ -550,7 +548,7 @@ var VirtualRenderer = function(container, theme) {
|
|||
|
||||
var col = Math.round((pageX + this.scroller.scrollLeft - canvasPos.left - this.$padding)
|
||||
/ this.characterWidth);
|
||||
var row = Math.floor((pageY + this.scrollTop - canvasPos.top - this.$padding)
|
||||
var row = Math.floor((pageY + this.scrollTop - canvasPos.top)
|
||||
/ this.lineHeight);
|
||||
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue