Fix globe center

This commit is contained in:
2026-05-13 12:49:40 +02:00
parent b88fb4ca9d
commit 17fe2330c6
3 changed files with 40 additions and 42 deletions
-14
View File
@@ -31,17 +31,3 @@ export function copyTextToClipboard(text) {
}
);
}
export function getOuterWidth(element) {
var style = getComputedStyle(element);
var width = element.offsetWidth; // Width without padding and border
width += parseInt(style.marginLeft) + parseInt(style.marginRight); // Add margins
// Check if the box-sizing is border-box (includes padding and border in the width)
if (style.boxSizing === 'border-box') {
width += parseInt(style.paddingLeft) + parseInt(style.paddingRight); // Add padding
width += parseInt(style.borderLeftWidth) + parseInt(style.borderRightWidth); // Add border
}
return width;
}