Skip to content

Commit 045db8d

Browse files
committed
Fix atlas renderer when drawing actors with spriped white spaces.
1 parent b164c53 commit 045db8d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

adventure-editor/src/main/java/com/bladecoder/engineeditor/ui/PackageDialog.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ public void run() {
170170
Ctx.project.getEditorConfig().setProperty(DIR_PROP, dir.getText());
171171

172172
for (InputPanel i : options) {
173-
Ctx.project.getEditorConfig().setProperty("package." + i.getTitle(), i.getText());
173+
if(i.getText() != null)
174+
Ctx.project.getEditorConfig().setProperty("package." + i.getTitle(), i.getText());
174175
}
175176

176177
Message.hideMsg();

blade-engine/src/com/bladecoder/engine/model/AtlasRenderer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,13 @@ public void draw(SpriteBatch batch, float x, float y, float scale) {
121121
}
122122

123123
x = x + tex.offsetX - tex.originalWidth / 2;
124-
y = y + tex.offsetY + tex.originalHeight * (scale - 1) / 2;
124+
y = y + tex.offsetY - tex.originalHeight * (1 - scale) / 2;
125125

126126
if (!flipX) {
127-
batch.draw(tex, x, y, tex.packedWidth / 2, tex.packedHeight / 2, tex.packedWidth, tex.packedHeight, scale,
127+
batch.draw(tex, x, y, tex.originalWidth / 2 - tex.offsetX, tex.originalHeight / 2 - tex.offsetY, tex.packedWidth, tex.packedHeight, scale,
128128
scale, 0);
129129
} else {
130-
batch.draw(tex, x + tex.packedWidth * scale, y, tex.packedWidth / 2, tex.packedHeight / 2, -tex.packedWidth,
130+
batch.draw(tex, x + tex.packedWidth * scale, y, tex.originalWidth / 2 - tex.offsetX, tex.originalHeight / 2 - tex.offsetY, -tex.packedWidth,
131131
tex.packedHeight, scale, scale, 0);
132132
}
133133
}

0 commit comments

Comments
 (0)