adapt line height of the hidden textarea

This commit is contained in:
Fabian Jakobs 2011-02-02 12:39:35 +01:00
commit ad1ac504b4
2 changed files with 5 additions and 4 deletions

View file

@ -34,8 +34,6 @@
<div id="editor">
</div>
</script>
<script src="demo/require.js" type="text/javascript" charset="utf-8"></script>
<script>

View file

@ -306,23 +306,26 @@ var VirtualRenderer = function(container, theme) {
if (useragent.isIE)
return;
if (!this.layerConfig)
return;
var pos = this.$cursorLayer.getPixelPosition();
if (!pos)
return;
var bounds = this.content.getBoundingClientRect();
var offset = (this.layerConfig && this.layerConfig.offset) || 0;
var offset = this.layerConfig.offset;
var left = bounds.left + pos.left + this.$padding;
var top = bounds.top + pos.top - this.scrollTop + offset;
if (useragent.isIPad) {
left -= 3;
top -= 0;
}
textarea.style.left = left + "px";
textarea.style.top = top + "px";
textarea.style.lineHeight = this.layerConfig.lineHeight + "px";
};
this.getFirstVisibleRow = function() {