From 36c77a3115d7b35db2fc2bcf17b8aa2c5ac4fc78 Mon Sep 17 00:00:00 2001 From: fusijie Date: Mon, 26 Feb 2018 16:20:17 +0800 Subject: [PATCH] fixed scrollView bug. --- cocos2d/core/CCNode.js | 4 ++-- cocos2d/core/components/CCScrollBar.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cocos2d/core/CCNode.js b/cocos2d/core/CCNode.js index 571a593e28..915da020e9 100644 --- a/cocos2d/core/CCNode.js +++ b/cocos2d/core/CCNode.js @@ -2178,8 +2178,8 @@ var Node = cc.Class({ math.mat4.invert(_mat4_temp, this._worldMatrix); let out = new cc.Vec2(); math.vec2.transformMat4(out, worldPoint, _mat4_temp); - out.x -= this._anchorPoint.x * this._contentSize.width; - out.y -= this._anchorPoint.y * this._contentSize.height; + out.x += this._anchorPoint.x * this._contentSize.width; + out.y += this._anchorPoint.y * this._contentSize.height; return out; }, diff --git a/cocos2d/core/components/CCScrollBar.js b/cocos2d/core/components/CCScrollBar.js index 9991a52b6c..670a580782 100644 --- a/cocos2d/core/components/CCScrollBar.js +++ b/cocos2d/core/components/CCScrollBar.js @@ -139,6 +139,7 @@ var Scrollbar = cc.Class({ _setOpacity: function(opacity) { if (this.handle) { this.node.setOpacity(opacity); + this.handle.node.setOpacity(opacity); } },