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 window size #1891

Merged
merged 8 commits into from Oct 30, 2019
Merged

fix window size #1891

merged 8 commits into from Oct 30, 2019

Conversation

@PPpro
Copy link
Contributor

@PPpro PPpro commented Oct 18, 2019

这个 pr 将会修复:

说明:
之前因为只在初始化时更新了 _width 和 _height, window resized 之后也没有实时更新 _width _height,所以导致渲染时 view 的宽高不正确
现在改为渲染时,实时获取屏幕宽高,并更新到 view 上
现在改为渲染时,从 Application 那里获取缓存的 viewSize,每次 window resize 都更新 viewSize

@PPpro PPpro mentioned this pull request Oct 18, 2019
@PPpro
Copy link
Contributor Author

@PPpro PPpro commented Oct 18, 2019

已修复平台:

  • iOS
  • Android
  • win32
  • mac

@cocos-robot cocos-robot changed the base branch from v2.2.0-release to v2.2.1-release Oct 21, 2019
Copy link
Contributor

@cocos-robot cocos-robot left a comment

@umbrellaPP, v2.2.0-release branch will be deleted, so we edited the base branch to v2.2.1-release, or this PR will be killed by GitHub.
Please review the commits history to ensure that the PR does not polluted by unneeded commits from your origin branch.
If you need to merge to other branch, you can first click the Edit button on the right side of the PR title, then switch the base branch.
If necessary, welcome to resubmit a new PR. Thanks!

@jareguo jareguo changed the base branch from v2.2.1-release to v2.2.2 Oct 21, 2019
@PPpro PPpro changed the base branch from v2.2.2 to v2.2.1-release Oct 27, 2019
@PPpro PPpro marked this pull request as ready for review Oct 28, 2019
@minggo
Copy link
Contributor

@minggo minggo commented Oct 28, 2019

这里要的是窗口大大小还是分辨率大小?这二者的含义是不一样的。从你接口来看,是要分辨率大小。

@PPpro
Copy link
Contributor Author

@PPpro PPpro commented Oct 28, 2019

这里要的是窗口大大小还是分辨率大小?这二者的含义是不一样的。从你接口来看,是要分辨率大小。

应该是 getViewSize 好一点,我改一下

@PPpro
Copy link
Contributor Author

@PPpro PPpro commented Oct 28, 2019

@minggo 接口问题已经更新

cocos/platform/CCApplication.h Outdated Show resolved Hide resolved
cocos/platform/CCApplication.h Outdated Show resolved Hide resolved
@PPpro
Copy link
Contributor Author

@PPpro PPpro commented Oct 29, 2019

已统一 updateViewSize 接口和 _viewSize 定义

cocos/platform/CCApplication.h Outdated Show resolved Hide resolved
minggo
minggo approved these changes Oct 29, 2019
@holycanvas holycanvas requested a review from 2youyou2 Oct 30, 2019
@minggo
Copy link
Contributor

@minggo minggo commented Oct 30, 2019

模拟器监听也没什么问题吧?开发者也可以通过旋转模拟器来模拟屏幕的转动。

@minggo
Copy link
Contributor

@minggo minggo commented Oct 30, 2019

Simulator 工程应该都不要有 iOS/Android,只要 win32/mac 工程就够了。

@minggo minggo merged commit de50eaa into cocos-creator:v2.2.1-release Oct 30, 2019
1 check passed
@PPpro
Copy link
Contributor Author

@PPpro PPpro commented Oct 30, 2019

另外提 pr 移除模拟器的 iOS 工程,这个 pr 没问题的话可以先合并了

@PPpro PPpro deleted the 22_view branch Nov 11, 2019
JoneLau added a commit to JoneLau/cocos2d-x-lite that referenced this issue Jan 20, 2020
JoneLau added a commit to JoneLau/cocos2d-x-lite that referenced this issue Feb 11, 2020
JoneLau added a commit to JoneLau/cocos2d-x-lite that referenced this issue Feb 25, 2020
Mee-gu pushed a commit to Mee-gu/cocos2d-x-lite that referenced this issue Mar 3, 2020
minggo pushed a commit that referenced this issue Mar 13, 2020
* impl window.devicePixelRatio

sync update(#2081 #1891)

* add framebuffer resize callback

* update review

* update reivew

* fix width and height

* reset file

* remove unneeded code

* remove unneeded codes

* revert ios file

Co-authored-by: Jone <350791117@qq.com>
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

6 participants