Fix screen not resizing and debug causing redraw

pull/1/head
cpsdqs 7 years ago
parent f84705f376
commit eef42af52b
Signed by untrusted user: cpsdqs
GPG Key ID: 3F59586BB7448DD1
  1. 10
      js/term/screen_layout.js

@ -22,7 +22,8 @@ module.exports = class ScreenLayout extends EventEmitter {
gridScaleY: 1.2,
fitIntoWidth: 0,
fitIntoHeight: 0,
graphics: 0
graphics: 0,
debug: false
}
// scaling caused by fitIntoWidth/fitIntoHeight
@ -42,8 +43,7 @@ module.exports = class ScreenLayout extends EventEmitter {
fontFamily: '',
fontSize: 0,
fitIntoWidth: 0,
fitIntoHeight: 0,
debug: false
fitIntoHeight: 0
}
this.charSize = { width: 0, height: 0 }
@ -202,6 +202,8 @@ module.exports = class ScreenLayout extends EventEmitter {
fitIntoHeight,
padding
} = this.window
this.updateCharSize()
const cellSize = this.getCellSize()
// real height of the canvas element in pixels
@ -241,8 +243,6 @@ module.exports = class ScreenLayout extends EventEmitter {
this.canvas.height = (height * cellSize.height + 2 * Math.round(this._padding)) * devicePixelRatio
this.canvas.style.height = `${realHeight}px`
this.updateCharSize()
// the screen has been cleared (by changing canvas width)
this.renderer.resetDrawn()

Loading…
Cancel
Save