From 475ea35b0c3a3d304cc024c94b9e1d76023df8b2 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Thu, 24 Aug 2017 17:15:23 +0800 Subject: [PATCH] fix sort bug in Scale9Sprite data pool --- cocos2d/core/sprites/CCScale9Sprite.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cocos2d/core/sprites/CCScale9Sprite.js b/cocos2d/core/sprites/CCScale9Sprite.js index fb6c5c747c..3d1b832ed0 100644 --- a/cocos2d/core/sprites/CCScale9Sprite.js +++ b/cocos2d/core/sprites/CCScale9Sprite.js @@ -32,7 +32,9 @@ var dataPool = { if (!this._pool[length]) { this._pool[length] = [data]; this._lengths.push(length); - this._lengths.sort(); + this._lengths.sort(function(a, b) { + return a - b; + }); } else { this._pool[length].push(data);