minor hidpi fix

main
Antonio De Lucreziis 2 years ago
parent 58b6b6ed18
commit 97db71878f

@ -23,7 +23,7 @@ async function storeContainers() {
async function cleanContainers() { async function cleanContainers() {
if (!(await stat('containers-db.local.json'))) { if (!(await stat('containers-db.local.json'))) {
storeContainers() await storeContainers()
} }
const raw = JSON.parse(await fs.readFile('containers-db.local.json', 'utf8')) const raw = JSON.parse(await fs.readFile('containers-db.local.json', 'utf8'))

@ -62,7 +62,7 @@ export class FitAddon implements ITerminalAddon {
const parentElementHeight = parseInt(parentElementStyle.getPropertyValue('height')) const parentElementHeight = parseInt(parentElementStyle.getPropertyValue('height'))
const parentElementWidth = Math.max(0, parseInt(parentElementStyle.getPropertyValue('width'))) const parentElementWidth = Math.max(0, parseInt(parentElementStyle.getPropertyValue('width')))
console.log(parentElementWidth, parentElementHeight) console.log(parentElementWidth, parentElementHeight, core._renderService)
const elementStyle = window.getComputedStyle(this._terminal.element) const elementStyle = window.getComputedStyle(this._terminal.element)
const elementPadding = { const elementPadding = {
@ -76,8 +76,8 @@ export class FitAddon implements ITerminalAddon {
const availableHeight = parentElementHeight - elementPaddingVer const availableHeight = parentElementHeight - elementPaddingVer
const availableWidth = parentElementWidth - elementPaddingHor const availableWidth = parentElementWidth - elementPaddingHor
const geometry = { const geometry = {
cols: Math.floor(availableWidth / core._renderService.dimensions.device.cell.width), cols: Math.floor(availableWidth / core._renderService.dimensions.css.cell.width),
rows: Math.floor(availableHeight / core._renderService.dimensions.device.cell.height), rows: Math.floor(availableHeight / core._renderService.dimensions.css.cell.height),
} }
return geometry return geometry
} }