2.0 alpha 11 issue fixes (#2694)

* Fix variable leak to global scope

* Fix Texture update issue

* Fix video player _playing state setting issue

* Improve macro doc
This commit is contained in:
pandamicro
2018-05-16 17:00:31 +08:00
committed by GitHub
parent bd2dd76826
commit a7a566ff2a
6 changed files with 9 additions and 6 deletions
+1 -1
View File
@@ -377,7 +377,7 @@ var Texture2D = cc.Class({
options.images.push(options.image);
}
if (options.images.length > 0) {
if (options.images && options.images.length > 0) {
this._texture.update(options);
}
}
+1 -1
View File
@@ -309,7 +309,7 @@ cc.macro = {
* You can set it to true before `cc.game.run`.
* Web only.
* !#zh
* 用于设置在创建 WebGL Context 时是否开启 `antialias` 选项,默认值是 false。
* 用于设置在创建 WebGL Context 时是否开启抗锯齿选项,默认值是 false。
* 将这个选项设置为 true 会让你的游戏画面稍稍平滑一些,比如旋转硬边贴图时的锯齿。是否开启这个选项很大程度上取决于你的游戏和面向的平台。
* 在大多数拥有 retina 级别屏幕的设备上用户往往无法区分这个选项带来的变化;如果你的游戏选择像素艺术风格,你也多半不会想开启这个选项。
* 同时,在少部分使用软件级别抗锯齿算法的设备或浏览器上,这个选项会对性能产生比较大的影响。
+1
View File
@@ -15,6 +15,7 @@ const POST_RENDER = 1 << 8;
const FINAL = 1 << 9;
let _walker = null;
let _cullingMask = 0;
//
function RenderFlow () {
@@ -110,7 +110,7 @@ let graphicsAssembler = {
let renderDatas = graphics._impl._renderDatas;
for (let index = 0, length = renderDatas.length; index < length; index++) {
let renderData = renderDatas[index];
let renderData = renderDatas[index],
data = renderData._data;
buffer.request(renderData.vertexCount, renderData.indiceCount);
@@ -77,7 +77,7 @@ module.exports = {
vbuf[vertexOffset+15] = uv[7];
let data0 = data[0], data3 = data[3],
vl = data0.x, vr = data3.x;
vl = data0.x, vr = data3.x,
vb = data0.y, vt = data3.y;
let al = a * vl, ar = a * vr,
+4 -2
View File
@@ -68,10 +68,12 @@ let VideoPlayerImpl = cc.Class({
});
video.addEventListener("play", function () {
if (self._video !== video) return;
self._playing = true;
self._dispatchEvent(VideoPlayerImpl.EventType.PLAYING);
});
video.addEventListener("pause", function () {
if (self._ignorePause || self._video !== video) return;
self._playing = false;
self._dispatchEvent(VideoPlayerImpl.EventType.PAUSED);
});
video.addEventListener("click", function () {
@@ -197,12 +199,12 @@ let VideoPlayerImpl = cc.Class({
var self = this;
setTimeout(function () {
video.play();
self._playing = true;
self._playing = !video.paused;
}, 20);
}
else {
video.play();
this._playing = true;
this._playing = !video.paused;
}
},