Skip to content

Loading…

Refactor #4308: Fix bug of director initialization #1657

Merged
merged 2 commits into from

2 participants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Showing with 3 additions and 2 deletions.
  1. +1 −0 CCBoot.js
  2. +0 −1 cocos2d/core/CCDirector.js
  3. +2 −1 cocos2d/core/platform/CCEGLView.js
View
1 CCBoot.js
@@ -1494,6 +1494,7 @@ cc._setup = function (el, width, height) {
// Director
cc.director = cc.Director._getInstance();
+ cc.director.setOpenGLView(cc.view);
cc.winSize = cc.director.getWinSize();
// IME Dispatcher
View
1 cocos2d/core/CCDirector.js
@@ -1192,7 +1192,6 @@ cc.Director._getInstance = function () {
cc.Director.firstUseDirector = false;
cc.Director.sharedDirector = new cc.DisplayLinkDirector();
cc.Director.sharedDirector.init();
- cc.Director.sharedDirector.setOpenGLView(cc.view);
}
return cc.Director.sharedDirector;
};
View
3 cocos2d/core/platform/CCEGLView.js
@@ -565,10 +565,11 @@ cc.EGLView = cc.Class.extend(/** @lends cc.EGLView# */{
},
_convertTouchesWithScale: function(touches){
- var locViewPortRect = this._viewPortRect, locScaleX = this._scaleX, locScaleY = this._scaleY, selTouch, selPoint;
+ var locViewPortRect = this._viewPortRect, locScaleX = this._scaleX, locScaleY = this._scaleY, selTouch, selPoint, selPrePoint;
for( var i = 0; i < touches.length; i ++){
selTouch = touches[i];
selPoint = selTouch._point;
+ selPrePoint = selTouch._prevPoint;
selTouch._setPoint((selPoint.x - locViewPortRect.x) / locScaleX,
(selPoint.y - locViewPortRect.y) / locScaleY);
selTouch._setPrevPoint((selPrePoint.x - locViewPortRect.x) / locScaleX,
Something went wrong with that request. Please try again.