fix deprecation warning
This commit is contained in:
parent
e277b33bd8
commit
176c6dc32a
2 changed files with 15 additions and 12 deletions
|
|
@ -23,8 +23,10 @@ export default function createCanvasText(
|
||||||
elem.textContent = elem.textContent?.toUpperCase() as string;
|
elem.textContent = elem.textContent?.toUpperCase() as string;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use provided text object or create a new one
|
// Use new PixiJS v8 syntax
|
||||||
const canvasText = textObject || new Text(elem.textContent as string, {
|
const canvasText = textObject || new Text({
|
||||||
|
text: elem.textContent as string,
|
||||||
|
style: {
|
||||||
fontFamily: elemFontFamily,
|
fontFamily: elemFontFamily,
|
||||||
fontSize: parseInt(elemFontSize),
|
fontSize: parseInt(elemFontSize),
|
||||||
fontWeight: elemFontWeight as PIXI.TextStyleFontWeight,
|
fontWeight: elemFontWeight as PIXI.TextStyleFontWeight,
|
||||||
|
|
@ -33,6 +35,7 @@ export default function createCanvasText(
|
||||||
fill: elemColor,
|
fill: elemColor,
|
||||||
align: elemAlignment as PIXI.TextStyleAlign,
|
align: elemAlignment as PIXI.TextStyleAlign,
|
||||||
padding: 20,
|
padding: 20,
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Update existing text object properties
|
// Update existing text object properties
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
console.log('layout mounted');
|
// console.log('layout mounted');
|
||||||
// Set initial random background color on first load
|
// Set initial random background color on first load
|
||||||
// setRandomBgColor();
|
setRandomBgColor();
|
||||||
});
|
});
|
||||||
|
|
||||||
let { children }: { children: Snippet } = $props();
|
let { children }: { children: Snippet } = $props();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue