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

Conversation

@umbrellaPP
Copy link
Contributor

umbrellaPP commented Oct 18, 2019

这个 pr 将会修复:

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

PP
@umbrellaPP umbrellaPP referenced this pull request Oct 18, 2019
PP
@umbrellaPP

This comment has been minimized.

Copy link
Contributor Author

umbrellaPP commented Oct 18, 2019

已修复平台:

  • iOS
  • Android
  • win32
  • mac
PP
@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 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
@umbrellaPP umbrellaPP changed the base branch from v2.2.2 to v2.2.1-release Oct 27, 2019
PP
@umbrellaPP umbrellaPP force-pushed the umbrellaPP:22_view branch from ae557f6 to bbe77aa Oct 28, 2019
@umbrellaPP umbrellaPP marked this pull request as ready for review Oct 28, 2019
@minggo

This comment has been minimized.

Copy link
Contributor

minggo commented Oct 28, 2019

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

@umbrellaPP

This comment has been minimized.

Copy link
Contributor Author

umbrellaPP commented Oct 28, 2019

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

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

@umbrellaPP

This comment has been minimized.

Copy link
Contributor Author

umbrellaPP commented Oct 28, 2019

@minggo 接口问题已经更新

@umbrellaPP umbrellaPP force-pushed the umbrellaPP:22_view branch from 4280fa4 to d58a62e Oct 28, 2019
PP
@umbrellaPP umbrellaPP force-pushed the umbrellaPP:22_view branch from d58a62e to a3734a7 Oct 28, 2019
cocos/platform/CCApplication.h Outdated Show resolved Hide resolved
cocos/platform/CCApplication.h Outdated Show resolved Hide resolved
PP
@umbrellaPP

This comment has been minimized.

Copy link
Contributor Author

umbrellaPP commented Oct 29, 2019

已统一 updateViewSize 接口和 _viewSize 定义

cocos/platform/CCApplication.h Outdated Show resolved Hide resolved
PP
@umbrellaPP umbrellaPP force-pushed the umbrellaPP:22_view branch from 31faf10 to 13b1eb8 Oct 29, 2019
@minggo
minggo approved these changes Oct 29, 2019
@holycanvas holycanvas requested a review from 2youyou2 Oct 30, 2019
@minggo

This comment has been minimized.

Copy link
Contributor

minggo commented Oct 30, 2019

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

@minggo

This comment has been minimized.

Copy link
Contributor

minggo commented Oct 30, 2019

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

@umbrellaPP umbrellaPP force-pushed the umbrellaPP:22_view branch from 7e9aa46 to 13b1eb8 Oct 30, 2019
@minggo minggo merged commit de50eaa into cocos-creator:v2.2.1-release Oct 30, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@umbrellaPP

This comment has been minimized.

Copy link
Contributor Author

umbrellaPP commented Oct 30, 2019

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

@umbrellaPP umbrellaPP deleted the umbrellaPP:22_view branch Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.