浏览代码

fix for index starting at 1

ncannasse 7 年之前
父节点
当前提交
97573437d2
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      hxd/res/Atlas.hx

+ 4 - 0
hxd/res/Atlas.hx

@@ -128,6 +128,10 @@ class Atlas extends Resource {
 				}
 				tl[index] = { t : t, width : origW, height : origH };
 			}
+			
+			// remove first element if index started at 1 instead of 0
+			for( tl in contents )
+				if( tl.length > 1 && tl[0] == null ) tl.shift();
 		}
 		return contents;
 	}