mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
remove unused logic
This commit is contained in:
@@ -357,10 +357,6 @@ var Button = cc.Class({
|
||||
this.node.on(cc.Node.EventType.MOUSE_LEAVE, this._onMouseMoveOut, this);
|
||||
},
|
||||
|
||||
_cancelButtonClick: function(){
|
||||
this._pressed = false;
|
||||
},
|
||||
|
||||
_applyTarget: function () {
|
||||
var target = this.target;
|
||||
if (target) {
|
||||
|
||||
@@ -787,32 +787,13 @@ var ScrollView = cc.Class({
|
||||
this._touchMoved = false;
|
||||
},
|
||||
|
||||
_cancelButtonClick: function(touch) {
|
||||
var deltaMove = touch.getDelta();
|
||||
var needCancelTouch = false;
|
||||
if (cc.sys.isMobile) {
|
||||
//FIXME: touch move delta should be calculated by DPI.
|
||||
var TOUCH_CANCEL_POINT = 7;
|
||||
if (cc.pLength(deltaMove) > TOUCH_CANCEL_POINT) {
|
||||
needCancelTouch = true;
|
||||
}
|
||||
} else {
|
||||
needCancelTouch = true;
|
||||
}
|
||||
|
||||
return needCancelTouch;
|
||||
},
|
||||
|
||||
_onTouchMoved: function(event) {
|
||||
var touch = event.touch;
|
||||
if (this.content) {
|
||||
var buttonComponent = event.target.getComponent(cc.Button);
|
||||
if (buttonComponent && this._cancelButtonClick(touch)) {
|
||||
buttonComponent._cancelButtonClick();
|
||||
}
|
||||
this._handleMoveLogic(touch);
|
||||
}
|
||||
var deltaMove = touch.getDelta();
|
||||
//FIXME: touch move delta should be calculated by DPI.
|
||||
if (cc.pLength(deltaMove) > 7) {
|
||||
this._touchMoved = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user