Skip to content

Fixes window border causes webviews to be positioned slightly off - #114061

Merged
Matt Bierner (mjbvz) merged 3 commits into
microsoft:masterfrom
jeanp413:fix-109127
Jan 9, 2021
Merged

Matt Bierner (mjbvz) merged 3 commits into
microsoft:masterfrom
jeanp413:fix-109127

Conversation

@jeanp413

Copy link
Copy Markdown
Contributor

This PR fixes #109127

@mjbvz

Copy link
Copy Markdown
Contributor

Thanks! I should have claimed this issue because I was literally fixing it too when this PR came in :)

This solution looks good but I think it may be a little more clean to avoid using the windowBorderSize value and instead try to compute the content offset for the parent element:

		const frameRect = element.getBoundingClientRect();
		const containerRect = this.container.parentElement.getBoundingClientRect();
		const parentBorderTop = (containerRect.height - this.container.parentElement.clientHeight) / 2.0;
		const parentBorderLeft = (containerRect.width - this.container.parentElement.clientWidth) / 2.0;

@mjbvz Matt Bierner (mjbvz) added this to the January 2021 milestone Jan 8, 2021
@jeanp413

Copy link
Copy Markdown
Contributor Author

Matt Bierner (@mjbvz) updated the PR, thanks.

@mjbvz
Matt Bierner (mjbvz) merged commit ea1b3f2 into microsoft:master Jan 9, 2021
@mjbvz

Copy link
Copy Markdown
Contributor

Thanks! Will be in the next insiders build and scheduled to ship with the January release

@jeanp413
Jean Pierre (jeanp413) deleted the fix-109127 branch January 9, 2021 00:46
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Window border causes webviews to be positioned slightly off

2 participants