mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
Merge pull request #2138 from pandamicro/next
Small issue fixes on next branch
This commit is contained in:
@@ -839,7 +839,6 @@ var Node = cc.Class({
|
||||
// Mouse event listener
|
||||
this._mouseListener = null;
|
||||
|
||||
this._contentSize = mathPools.vec2.get();
|
||||
this._anchorPoint = mathPools.vec2.get();
|
||||
this._anchorPoint.x = this._anchorPoint.y = 0.5;
|
||||
this._scale = mathPools.vec2.get();
|
||||
@@ -901,7 +900,6 @@ var Node = cc.Class({
|
||||
cc.eventManager.removeListeners(this);
|
||||
|
||||
// Recycle math objects
|
||||
mathPools.vec2.put(this._contentSize);
|
||||
mathPools.vec2.put(this._anchorPoint);
|
||||
mathPools.vec2.put(this._scale);
|
||||
mathPools.vec3.put(this._position);
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
var JS = require('../platform/js');
|
||||
var sys = require('../platform/CCSys');
|
||||
var Path = require('../utils/CCPath');
|
||||
var misc = require('../utils/misc');
|
||||
var Pipeline = require('./pipeline');
|
||||
var PackDownloader = require('./pack-downloader');
|
||||
// var downloadBinary = require('./binary-downloader');
|
||||
@@ -83,7 +82,7 @@ function downloadImage (item, callback, isCrossOrigin, img) {
|
||||
}
|
||||
|
||||
var url = urlAppendTimestamp(item.url);
|
||||
img = img || misc.imagePool.get();
|
||||
img = img || new Image();
|
||||
if (isCrossOrigin && window.location.protocol !== 'file:') {
|
||||
img.crossOrigin = 'anonymous';
|
||||
}
|
||||
|
||||
+889
-884
File diff suppressed because it is too large
Load Diff
@@ -113,22 +113,6 @@ if (CC_EDITOR) {
|
||||
};
|
||||
}
|
||||
|
||||
misc.imagePool = new JS.Pool(function (img) {
|
||||
if (img instanceof HTMLImageElement) {
|
||||
img.src = this._smallImg;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}, 10);
|
||||
misc.imagePool.get = function () {
|
||||
return this._get() || new Image();
|
||||
};
|
||||
misc.imagePool._smallImg = "data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=";
|
||||
// Avoid problems on windows IE kernels, Edge, Firefox and Linux Firefox
|
||||
if ((sys.os === sys.OS_WINDOWS || sys.os === sys.OS_LINUX) && sys.browserType !== sys.BROWSER_TYPE_CHROME) {
|
||||
misc.imagePool.resize(0);
|
||||
}
|
||||
|
||||
misc.BUILTIN_CLASSID_RE = /^(?:cc|dragonBones|sp|ccsg)\..+/;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user