Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #2488. Use element offsetHeight rather than getBoundingRect #4366

Merged
merged 3 commits into from
Aug 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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