2
0
mirror of https://github.com/iconify/iconify.git synced 2024-09-19 16:59:02 +00:00

Minor changes to web component code

This commit is contained in:
Vjacheslav Trushkin 2022-05-20 21:13:30 +03:00
parent 95ff16aee9
commit 63322d9e0a

View File

@ -11,7 +11,9 @@ const viewBoxProps: (keyof IconifyIcon)[] = ['left', 'top', 'width', 'height'];
* Render icon
*/
export function renderIcon(parent: Element | ShadowRoot, state: RenderedState) {
let iconData = state.icon.data;
const iconData = {
...state.icon.data,
};
const customisations = state.customisations;
// Custom viewBox
@ -31,10 +33,7 @@ export function renderIcon(parent: Element | ShadowRoot, state: RenderedState) {
}
if (!failed) {
iconData = {
...iconData,
...customisedViewBox,
};
Object.assign(iconData, customisedViewBox);
}
}
}