Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-10-23 17:43:25 +03:00
parent f6fea34821
commit 9ecbf4e060
2 changed files with 5 additions and 1 deletions

View File

@ -1057,6 +1057,7 @@ var Outline = {
var stack = this.__crop_stack ??= [] var stack = this.__crop_stack ??= []
stack.push([this.json(), this.path()]) stack.push([this.json(), this.path()])
this.load(this.data()) this.load(this.data())
this.dom.classList.add('crop')
return this }, return this },
// XXX use JSON API... // XXX use JSON API...
uncrop: function(){ uncrop: function(){
@ -1064,7 +1065,8 @@ var Outline = {
return this} return this}
var [state, path] = this.__crop_stack.pop() var [state, path] = this.__crop_stack.pop()
if(this.__crop_stack.length == 0){ if(this.__crop_stack.length == 0){
this.__crop_stack = undefined } this.__crop_stack = undefined
this.dom.classList.remove('crop') }
// update state... // update state...
path path
.slice(0, -1) .slice(0, -1)

View File

@ -76,6 +76,8 @@ HTMLTextAreaElement.prototype.getTextGeometry = function(){
span.append( span.append(
text.slice(0, offset), text.slice(0, offset),
carret, carret,
// NOTE: wee need the rest of the text for the carret to be typeset
// to the correct line...
text.slice(offset)) text.slice(offset))
document.body.append(span) document.body.append(span)