diff --git a/experiments/outline-editor/editor.js b/experiments/outline-editor/editor.js index 643db70..b017692 100755 --- a/experiments/outline-editor/editor.js +++ b/experiments/outline-editor/editor.js @@ -69,7 +69,7 @@ var getCharOffset = function(elem, x, y, c){ return Math.abs(b.x - x) <= Math.abs(prev.x - x) ? c + i : c + i - 1 } } - c += i + c += i - 1 // html node... } else { var res = getCharOffset(e, x, y, c) @@ -1974,6 +1974,7 @@ var Outline = { elem.selectionStart = elem.value.length elem.selectionEnd = elem.value.length } else { + console.log('---', c) var m = getMarkdownOffset(elem.value, view.innerText, c) elem.focus() elem.selectionStart = c + m diff --git a/experiments/outline-editor/generic.js b/experiments/outline-editor/generic.js index ca38e20..f148723 100755 --- a/experiments/outline-editor/generic.js +++ b/experiments/outline-editor/generic.js @@ -60,15 +60,20 @@ HTMLTextAreaElement.prototype.getTextGeometry = function(){ position: 'fixed', display: 'block', + /* DEBUG... + top: '0px', + left: '0px', + /*/ top: '-100%', left: '-100%', + //*/ width: style.width, height: style.height, padding: style.padding, boxSizing: style.boxSizing, - //whiteSpace: 'pre-wrap', + whiteSpace: style.whiteSpace, outline: 'solid 1px red', diff --git a/experiments/outline-editor/index.html b/experiments/outline-editor/index.html index c1af6c6..41745bd 100755 --- a/experiments/outline-editor/index.html +++ b/experiments/outline-editor/index.html @@ -48,9 +48,6 @@ var setup = function(){ - - ## Bugs: focused:: true - - BUG: focus at times seems to be biased a bit to the right -- the caret is placed to the right from where expected... - - - _this seems to only affect text with leading whitespace only, like this._ - BUG: mobile browsers behave quite chaotically ignoring parts of the styling... - FF: - zooming on edited field