Skip to content

Commit

Permalink
Merge pull request #4366 from arekouzounian/master
Browse files Browse the repository at this point in the history
Fix for #2488. Use element offsetHeight rather than getBoundingRect
  • Loading branch information
Tyriar committed Aug 1, 2023
2 parents 2d81490 + 5939d72 commit ce3bb35
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/browser/services/CharSizeService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ class DomMeasureStrategy implements IMeasureStrategy {
this._measureElement.style.fontSize = `${this._optionsService.rawOptions.fontSize}px`;

// Note that this triggers a synchronous layout
const geometry = this._measureElement.getBoundingClientRect();
const geometry = {
height: Number(this._measureElement.offsetHeight),
width: Number(this._measureElement.offsetWidth)
};

// If values are 0 then the element is likely currently display:none, in which case we should
// retain the previous value.
Expand Down

0 comments on commit ce3bb35

Please sign in to comment.