Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix _histTest ignore scale bug #4456

Merged
merged 1 commit into from May 20, 2019

Conversation

@knoxHuang
Copy link
Contributor

@knoxHuang knoxHuang commented May 20, 2019

Re: scrollview 的 sclaeY 设置为 0 时,button 无响应,button 与 scrollview 都是同一个父节点节点下的

Changes:

  • 修复 _hitTest 忽略了 scale 的计算,导致 scale 为 0 还是会显示 hit
@knoxHuang knoxHuang requested a review from pandamicro May 20, 2019
@@ -1815,8 +1815,8 @@ var Node = cc.Class({
},

_hitTest (point, listener) {
let w = this._contentSize.width,
h = this._contentSize.height,
let w = this._contentSize.width * this._scale.x,
Copy link
Contributor

@2youyou2 2youyou2 May 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这么改肯定不对,下面的 transform 计算已经包含了节点的 scale 的计算

@2youyou2 2youyou2 merged commit a42dcda into cocos-creator:v2.0.10-release May 20, 2019
1 check passed
@jareguo
Copy link
Member

@jareguo jareguo commented May 20, 2019

修复 ScrollView 或 Mask 所在节点 Scale 为 0 时,平级节点可能无法响应点击的问题

jareguo added a commit that referenced this issue May 23, 2019
* commit '70b47cef5197dead34813347b9d4ddd1c30e4165':
  refine uuid-loader error log code (#4492)
  add baidu subcontext view help url for 2d-tasks/issues/1465 (#4491)
  refine item error log (#4487)
  Fix spine cache error when change skin (#4488)
  fix instantiate prefab scale error (#4454)
  fix spine and dragonbones update cache bug (#4457)
  fix _histTest ignore scale bug (#4456)
  merge xiaomi (#4447)
  Optimize spine and dragonbones animation cache (#4387)
  update test-deserialize code (#4432)

# Conflicts:
#	cocos2d/core/CCNode.js
#	cocos2d/core/components/CCMask.js
#	extensions/dragonbones/ArmatureDisplay.js
jareguo added a commit that referenced this issue May 23, 2019
* v2.1.2:
  refine uuid-loader error log code (#4492)
  add baidu subcontext view help url for 2d-tasks/issues/1465 (#4491)
  refine item error log (#4487)
  Fix spine cache error when change skin (#4488)
  refine docs (#4477)
  fixed generate animation joint matrix (#4475)
  add canvas don't support button disabled state for 2d-tasks/issues/1451 (#4474)
  fix instantiate prefab scale error (#4454)
  fixed the creator.d.ts error (#4372)
  fix spine and dragonbones update cache bug (#4457)
  fix _histTest ignore scale bug (#4456)
  add builtin-2d-base material (#4443)
  merge xiaomi (#4447)
  Fix the problem that the bitmap mode of label is invalid. (#4393)
  Optimize spine and dragonbones animation cache (#4387)
  update test-deserialize code (#4432)

# Conflicts:
#	cocos2d/core/CCNode.js
#	extensions/spine/Skeleton.js
@knoxHuang knoxHuang deleted the fix-bug-temp branch Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants