mirror of
https://git.proxmox.com/git/mirror_xterm.js
synced 2025-11-03 19:28:22 +00:00
fixed width of fit
removed firefox hack since it is no longer needed
This commit is contained in:
parent
85733fea56
commit
d9d99c1c27
@ -20,7 +20,7 @@
|
||||
} else {
|
||||
/*
|
||||
* Plain browser environment
|
||||
*/
|
||||
*/
|
||||
fit(this.Xterm);
|
||||
}
|
||||
})(function (Xterm) {
|
||||
@ -44,22 +44,12 @@
|
||||
|
||||
subjectRow.style.display = 'inline';
|
||||
subjectRow.innerHTML = 'W'; // Common character for measuring width, although on monospace
|
||||
characterWidth = parseInt(subjectRow.offsetWidth);
|
||||
characterWidth = subjectRow.getBoundingClientRect().width;
|
||||
subjectRow.style.display = ''; // Revert style before calculating height, since they differ.
|
||||
characterHeight = parseInt(subjectRow.offsetHeight);
|
||||
subjectRow.innerHTML = contentBuffer;
|
||||
|
||||
rows = parseInt(availableHeight / characterHeight);
|
||||
/*
|
||||
* The following hack takes place in order to get "fit" work properly
|
||||
* in Mozilla Firefox.
|
||||
* Most probably, because of a dimension calculation bug, Firefox
|
||||
* calculates the width to be 1px less than it is actually drawn on
|
||||
* screen.
|
||||
*/
|
||||
if (navigator.userAgent.match(/Firefox/)) {
|
||||
characterWidth++;
|
||||
}
|
||||
cols = parseInt(availableWidth / characterWidth);
|
||||
|
||||
geometry = {cols: cols, rows: rows};
|
||||
@ -71,4 +61,4 @@
|
||||
|
||||
this.resize(geometry.cols, geometry.rows);
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user