xterm fix
This commit is contained in:
parent
bc82d87541
commit
eb086dfd74
|
@ -27,15 +27,24 @@ ISOTerminal.prototype.xtermInit = function(){
|
||||||
})
|
})
|
||||||
|
|
||||||
term.onRender( () => {
|
term.onRender( () => {
|
||||||
|
return
|
||||||
|
|
||||||
|
// xterm relies on requestAnimationFrame (which does not called in immersive mode)
|
||||||
let _window = term._core._coreBrowserService._window
|
let _window = term._core._coreBrowserService._window
|
||||||
if( !_window.requestAnimationFrameAFRAME ){ // patch the planet!
|
if( !_window.requestAnimationFrameAFRAME ){ // patch the planet!
|
||||||
|
|
||||||
// xterm relies on requestAnimationFrame (which does not called in immersive mode)
|
_window.requestAnimationFrameAFRAME = function(cb){
|
||||||
_window.requestAnimationFrameAFRAME =
|
if( term.tid != null ) clearTimeout(term.tid)
|
||||||
AFRAME.utils.throttleLeadingAndTrailing( function(cb){
|
term.tid = setTimeout( function(){
|
||||||
|
console.log("render")
|
||||||
cb()
|
cb()
|
||||||
},150 )
|
term.tid = null
|
||||||
|
},100)
|
||||||
|
}
|
||||||
|
//_window.requestAnimationFrameAFRAME =
|
||||||
|
// AFRAME.utils.throttleLeadingAndTrailing( function(cb){
|
||||||
|
// cb()
|
||||||
|
// },150 )
|
||||||
|
|
||||||
// we proxy the _window object of xterm, and reroute
|
// we proxy the _window object of xterm, and reroute
|
||||||
// requestAnimationFrame to requestAnimationFrameAFRAME
|
// requestAnimationFrame to requestAnimationFrameAFRAME
|
||||||
|
|
Loading…
Reference in New Issue