|
|
@ -92,20 +92,20 @@ module.exports = class TermScreen extends EventEmitter { |
|
|
|
if (selecting) return |
|
|
|
if (selecting) return |
|
|
|
selecting = true |
|
|
|
selecting = true |
|
|
|
this.selection.start = this.selection.end = this.layout.screenToGrid(x, y, true) |
|
|
|
this.selection.start = this.selection.end = this.layout.screenToGrid(x, y, true) |
|
|
|
this.layout.scheduleDraw('select-start') |
|
|
|
this.renderScreen('select-start') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let selectMove = (x, y) => { |
|
|
|
let selectMove = (x, y) => { |
|
|
|
if (!selecting) return |
|
|
|
if (!selecting) return |
|
|
|
this.selection.end = this.layout.screenToGrid(x, y, true) |
|
|
|
this.selection.end = this.layout.screenToGrid(x, y, true) |
|
|
|
this.layout.scheduleDraw('select-move') |
|
|
|
this.renderScreen('select-move') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let selectEnd = (x, y) => { |
|
|
|
let selectEnd = (x, y) => { |
|
|
|
if (!selecting) return |
|
|
|
if (!selecting) return |
|
|
|
selecting = false |
|
|
|
selecting = false |
|
|
|
this.selection.end = this.layout.screenToGrid(x, y, true) |
|
|
|
this.selection.end = this.layout.screenToGrid(x, y, true) |
|
|
|
this.layout.scheduleDraw('select-end') |
|
|
|
this.renderScreen('select-end') |
|
|
|
Object.assign(this.selection, this.getNormalizedSelection()) |
|
|
|
Object.assign(this.selection, this.getNormalizedSelection()) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -197,7 +197,7 @@ module.exports = class TermScreen extends EventEmitter { |
|
|
|
// reset selection
|
|
|
|
// reset selection
|
|
|
|
this.selection.start = this.selection.end = [0, 0] |
|
|
|
this.selection.start = this.selection.end = [0, 0] |
|
|
|
this.emit('hide-touch-select-menu') |
|
|
|
this.emit('hide-touch-select-menu') |
|
|
|
this.layout.scheduleDraw('select-reset') |
|
|
|
this.renderScreen('select-reset') |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
e.preventDefault() |
|
|
|
e.preventDefault() |
|
|
|
this.emit('open-soft-keyboard') |
|
|
|
this.emit('open-soft-keyboard') |
|
|
@ -260,13 +260,20 @@ module.exports = class TermScreen extends EventEmitter { |
|
|
|
this.layout.window.height = this.window.height |
|
|
|
this.layout.window.height = this.window.height |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
renderScreen () { |
|
|
|
renderScreen (reason) { |
|
|
|
this.layout.render({ |
|
|
|
let selection = [] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (let cell = 0; cell < this.screen.length; cell++) { |
|
|
|
|
|
|
|
selection.push(this.isInSelection(cell % this.window.width, Math.floor(cell / this.window.width))) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.layout.render(reason, { |
|
|
|
width: this.window.width, |
|
|
|
width: this.window.width, |
|
|
|
height: this.window.height, |
|
|
|
height: this.window.height, |
|
|
|
screen: this.screen, |
|
|
|
screen: this.screen, |
|
|
|
screenFG: this.screenFG, |
|
|
|
screenFG: this.screenFG, |
|
|
|
screenBG: this.screenBG, |
|
|
|
screenBG: this.screenBG, |
|
|
|
|
|
|
|
screenSelection: selection, |
|
|
|
screenAttrs: this.screenAttrs, |
|
|
|
screenAttrs: this.screenAttrs, |
|
|
|
cursor: this.cursor, |
|
|
|
cursor: this.cursor, |
|
|
|
statusScreen: this.window.statusScreen |
|
|
|
statusScreen: this.window.statusScreen |
|
|
@ -468,7 +475,7 @@ module.exports = class TermScreen extends EventEmitter { |
|
|
|
this.cursor.hanging = update.hanging |
|
|
|
this.cursor.hanging = update.hanging |
|
|
|
this.layout.renderer.resetCursorBlink() |
|
|
|
this.layout.renderer.resetCursorBlink() |
|
|
|
this.emit('cursor-moved') |
|
|
|
this.emit('cursor-moved') |
|
|
|
this.layout.renderer.scheduleDraw('cursor-moved') |
|
|
|
this.renderScreen('cursor-moved') |
|
|
|
} |
|
|
|
} |
|
|
|
break |
|
|
|
break |
|
|
|
|
|
|
|
|
|
|
@ -519,7 +526,7 @@ module.exports = class TermScreen extends EventEmitter { |
|
|
|
|
|
|
|
|
|
|
|
if (this.window.debug) console.log(`Blinking cells: ${this.blinkingCellCount}`) |
|
|
|
if (this.window.debug) console.log(`Blinking cells: ${this.blinkingCellCount}`) |
|
|
|
|
|
|
|
|
|
|
|
this.layout.renderer.scheduleDraw('load', 16) |
|
|
|
this.renderScreen('load') |
|
|
|
this.emit('load') |
|
|
|
this.emit('load') |
|
|
|
break |
|
|
|
break |
|
|
|
|
|
|
|
|
|
|
|