mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
Add debug code for zoomFactor.
This commit is contained in:
parent
3fa9330c83
commit
5e33132153
@ -233,7 +233,7 @@ class SpineC3PluginInstance extends SDK.IWorldInstanceBase {
|
||||
|
||||
if (errorsString) {
|
||||
const webglText = this.getErrorTextC3(iRenderer, this.layoutView);
|
||||
webglText.SetSize(_inst.GetWidth(), _inst.GetHeight(), this.layoutView.GetZoomFactor());
|
||||
webglText.SetSize(_inst.GetWidth(), _inst.GetHeight(), this.debugZoomFactor(iDrawParams));
|
||||
webglText.SetText(errorsString);
|
||||
|
||||
const texture = webglText.GetTexture();
|
||||
@ -247,6 +247,21 @@ class SpineC3PluginInstance extends SDK.IWorldInstanceBase {
|
||||
}
|
||||
}
|
||||
|
||||
private debugZoomFactor (iDrawParams: SDK.Gfx.IDrawParams) {
|
||||
const layoutView = iDrawParams.GetLayoutView();
|
||||
let count = 1000;
|
||||
let zoom = -1;
|
||||
while (zoom === -1 && count-- > 0) {
|
||||
try {
|
||||
zoom = layoutView.GetZoomFactor();
|
||||
} catch (error) {
|
||||
console.log("error ZOOM: ", error);
|
||||
}
|
||||
}
|
||||
return zoom === -1 ? 1 : zoom;
|
||||
|
||||
}
|
||||
|
||||
private setAnimation () {
|
||||
const propValue = this._inst.GetPropertyValue(PLUGIN_CLASS.PROP_ANIMATION) as string;
|
||||
this.animation = propValue === "" ? undefined : propValue;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user