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