mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Fixed NPE if file failed to load.
This commit is contained in:
parent
9cb1a2852b
commit
e38213fb67
@ -232,16 +232,18 @@ public class SkeletonViewer extends ApplicationAdapter {
|
|||||||
ui.stage.draw();
|
ui.stage.draw();
|
||||||
|
|
||||||
// Draw indicator for timeline position.
|
// Draw indicator for timeline position.
|
||||||
ShapeRenderer shapes = debugRenderer.getShapeRenderer();
|
if (state != null) {
|
||||||
TrackEntry entry = state.getCurrent(0);
|
ShapeRenderer shapes = debugRenderer.getShapeRenderer();
|
||||||
if (entry != null) {
|
TrackEntry entry = state.getCurrent(0);
|
||||||
float percent = entry.getTime() / entry.getEndTime();
|
if (entry != null) {
|
||||||
if (entry.getLoop()) percent %= 1;
|
float percent = entry.getTime() / entry.getEndTime();
|
||||||
float x = ui.window.getRight() + (Gdx.graphics.getWidth() - ui.window.getRight()) * percent;
|
if (entry.getLoop()) percent %= 1;
|
||||||
shapes.setColor(Color.CYAN);
|
float x = ui.window.getRight() + (Gdx.graphics.getWidth() - ui.window.getRight()) * percent;
|
||||||
shapes.begin(ShapeType.Line);
|
shapes.setColor(Color.CYAN);
|
||||||
shapes.line(x, 0, x, 20);
|
shapes.begin(ShapeType.Line);
|
||||||
shapes.end();
|
shapes.line(x, 0, x, 20);
|
||||||
|
shapes.end();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user