Fixed reference bug.
This commit is contained in:
@@ -258,6 +258,31 @@ export class Vector {
|
||||
}
|
||||
}
|
||||
|
||||
export class PIXIUtils {
|
||||
/*
|
||||
* Transform a pixi text to it's actual screensize,
|
||||
* ignoring it's local transforms
|
||||
*/
|
||||
static toScreenFontSize(pixiText, fontSize = null) {
|
||||
pixiText._recursivePostUpdateTransform();
|
||||
|
||||
let normalizedScale = {
|
||||
x: pixiText.scale.x / pixiText.transform.worldTransform.a,
|
||||
y: pixiText.scale.x / pixiText.transform.worldTransform.d
|
||||
};
|
||||
|
||||
pixiText.scale = { x: normalizedScale.x, y: normalizedScale.y };
|
||||
if (fontSize) pixiText.style.fontSize = fontSize;
|
||||
}
|
||||
|
||||
static saveFill(graphics) {
|
||||
return {
|
||||
fill: graphics.fill.color,
|
||||
alpha: graphics.fill.alpha
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The EventHandler class is used to take care of a event based design
|
||||
* pattern. Callbacks can subscribe to an event and these unknown sources
|
||||
|
||||
Reference in New Issue
Block a user