             for (var ii :int = 0; ii < _unpacked.length; ++ii) {
                 var unpacked :SwfTexture = _unpacked[ii];
 
-                if (unpacked.w > _maxSize || unpacked.h > _maxSize) {
+                if (unpacked.w > _maxAtlasSize || unpacked.h > _maxAtlasSize) {
                     throw new Error("Too large to fit in an atlas: " + unpacked.w + ", " +
                         unpacked.h + " " + unpacked.symbol);
                 }

        return p;
    }

    protected var _maxSize :int;
    protected var _borderSize :int;

    protected const _unpacked :Vector.<SwfTexture> = new Vector.<SwfTexture>();


            else size.y *= 2;
        }

        size.x = Math.min(size.x, _maxAtlasSize);
        size.y = Math.min(size.y, _maxAtlasSize);

        return size;
    }
