From 237f9b810aac813f24010cf945d5c54282abbc1b Mon Sep 17 00:00:00 2001 From: yinkaile <501251991@qq.com> Date: Mon, 29 Jan 2018 14:16:34 +0800 Subject: [PATCH] fixed graphics clear --- cocos2d/core/graphics/graphics.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cocos2d/core/graphics/graphics.js b/cocos2d/core/graphics/graphics.js index c0e21c63f7..66fc58faab 100644 --- a/cocos2d/core/graphics/graphics.js +++ b/cocos2d/core/graphics/graphics.js @@ -436,8 +436,9 @@ let Graphics = cc.Class({ } else { for (let i = 0, l = datas.length; i < l; i++) { - datas[i].dataLength = 0; - datas[i]._indices.length = 0; + let data = datas[i]; + data.vertexCount = data.indiceCount = data.dataLength = 0; + data._indices.length = 0; } } },