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

refine matrix calculation for editBox, videoPlayer and webview #201

Merged
merged 3 commits into from Nov 8, 2019

Conversation

PPpro
Copy link
Contributor

@PPpro PPpro commented Nov 7, 2019

cocos/2d-tasks#2047

changeLog:

  • 修复原生平台,当节点 scale 不为 1 时, editBox、webview、videoPlayer 显示位置出现偏移的问题
  • 原生平台,观察空间变换参与到 editBox、webview、videoPlayer 的位置计算中

@holycanvas holycanvas requested a review from knoxHuang Nov 8, 2019
@@ -103,7 +104,6 @@
video.pause();
this._playing = false;
}
this._forceUpdate = true;
Copy link
Contributor Author

@PPpro PPpro Nov 8, 2019

Choose a reason for hiding this comment

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

let dpr = cc.view._devicePixelRatio;

let math = cc.vmath;
let matrix = math.mat4.create();
node.getWorldMatrix(matrix);
let worldMat = math.mat4.create(),
Copy link
Collaborator

@holycanvas holycanvas Nov 8, 2019

Choose a reason for hiding this comment

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

worldMat 和 cameraMat 都是用来辅助计算的变量,直接作为全局变量?不用每次计算create一个

Copy link
Contributor Author

@PPpro PPpro Nov 8, 2019

Choose a reason for hiding this comment

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

已更新

@holycanvas holycanvas merged commit 759331b into cocos-creator-packages:v2.2.1-release Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants