瀏覽代碼

Merge pull request #204 from Fraggle/patch-2

Fix related to Starling update
Nathan Sweet 11 年之前
父節點
當前提交
a94927968c
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      spine-starling/spine-starling/src/spine/starling/StarlingAtlasAttachmentLoader.as

+ 4 - 4
spine-starling/spine-starling/src/spine/starling/StarlingAtlasAttachmentLoader.as

@@ -57,12 +57,12 @@ public class StarlingAtlasAttachmentLoader implements AttachmentLoader {
 			var frame:Rectangle = texture.frame;
 			texture = Texture.fromTexture(texture); // Discard frame.
 			regionAttachment.rendererObject = new SkeletonImage(texture);
-			regionAttachment.regionOffsetX = -frame.x;
-			regionAttachment.regionOffsetY = -frame.y;
+			regionAttachment.regionOffsetX = frame ? -frame.x : 0;
+			regionAttachment.regionOffsetY = frame ? -frame.y : 0;
 			regionAttachment.regionWidth = texture.width;
 			regionAttachment.regionHeight = texture.height;
-			regionAttachment.regionOriginalWidth = frame.width;
-			regionAttachment.regionOriginalHeight = frame.height;
+			regionAttachment.regionOriginalWidth = frame ? frame.width : texture.width;
+			regionAttachment.regionOriginalHeight = frame ? frame.height : texture.height;
 			return regionAttachment;
 		case AttachmentType.boundingbox:
 			return new BoundingBoxAttachment(name);