From f0accfee83dc6769d3d85fcc8df4877f55185ea3 Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 4 May 2012 13:04:11 +0400 Subject: [PATCH] fix gutter rendering when scrolling --- lib/ace/css/editor.css | 4 ++-- lib/ace/virtual_renderer.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ace/css/editor.css b/lib/ace/css/editor.css index 11831f03..44a9c452 100644 --- a/lib/ace/css/editor.css +++ b/lib/ace/css/editor.css @@ -42,8 +42,8 @@ width: 100%; } -.ace_gutter.horscroll { - box-shadow: 0px 0px 20px rgba(0,0,0,0.4); +.ace_scroller.horscroll { + box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset; } .ace_gutter-cell { diff --git a/lib/ace/virtual_renderer.js b/lib/ace/virtual_renderer.js index d85de6eb..a4c3906b 100644 --- a/lib/ace/virtual_renderer.js +++ b/lib/ace/virtual_renderer.js @@ -472,7 +472,7 @@ var VirtualRenderer = function(container, theme) { }; this.$updateGutterLineHighlight = function() { - this.$gutterLineHighlight.style.top = this.$cursorLayer.$pixelPos.top + "px"; + this.$gutterLineHighlight.style.top = this.$cursorLayer.$pixelPos.top - this.layerConfig.offset + "px"; this.$gutterLineHighlight.style.height = this.layerConfig.lineHeight + "px"; }; @@ -782,7 +782,7 @@ var VirtualRenderer = function(container, theme) { // For debugging. // console.log(JSON.stringify(this.layerConfig)); - this.$gutter.style.marginTop = (-offset) + "px"; + this.$gutterLayer.element.style.marginTop = (-offset) + "px"; this.content.style.marginTop = (-offset) + "px"; this.content.style.width = longestLine + 2 * this.$padding + "px"; this.content.style.height = minHeight + "px"; @@ -1107,7 +1107,7 @@ var VirtualRenderer = function(container, theme) { * **/ this.scrollToX = function(scrollLeft) { - if (scrollLeft <= this.$padding) + if (scrollLeft < 0) scrollLeft = 0; if (this.scrollLeft !== scrollLeft)