adapt line height of the hidden textarea
This commit is contained in:
parent
c01deb9798
commit
ad1ac504b4
2 changed files with 5 additions and 4 deletions
|
|
@ -34,8 +34,6 @@
|
|||
<div id="editor">
|
||||
</div>
|
||||
|
||||
</script>
|
||||
|
||||
<script src="demo/require.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script>
|
||||
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue