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

add constrain for wechat logo default ratio #15627

Merged
merged 2 commits into from
Jul 6, 2023

Conversation

mmyduckx
Copy link
Contributor

@mmyduckx mmyduckx commented Jul 5, 2023

Re: #https://github.com/cocos/3d-tasks/issues/17084

Changelog


Continuous Integration

This pull request:

  • needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • changes public API, and have ensured backward compatibility with deprecated features.
  • affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • affects file structure of the build package or build configuration which requires user project upgrade.
  • introduces breaking changes, please list all changes, affected features and the scope of violation.

@mmyduckx mmyduckx requested a review from minggo July 5, 2023 09:54
@github-actions
Copy link

github-actions bot commented Jul 5, 2023

Interface Check Report

This pull request does not change any public interfaces !

@minggo
Copy link
Contributor

minggo commented Jul 5, 2023

The titles says the constrain is for wechat logo, but the logic is for all minigames.

@minggo
Copy link
Contributor

minggo commented Jul 5, 2023

Ok, it is my fault. It is in wechat template.

const widthRatio = image.width / canvas.width * 1.35 * displayRatio;
const heightRatio = image.height / canvas.height * 1.35 * displayRatio;
// By default, maintain aspect ratio by constraining display at 200px height
const defaultRatio = 200 / image.width;
Copy link
Contributor

@minggo minggo Jul 5, 2023

Choose a reason for hiding this comment

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

Why use 200? It is a magic number.

Copy link
Contributor Author

@mmyduckx mmyduckx Jul 5, 2023

Choose a reason for hiding this comment

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

  1. cocos default logo size is 140 * 200
    image
  2. defualt height in splashScreen.ts is also 200
    image

@minggo minggo merged commit b3eeaba into cocos:v3.8.1 Jul 6, 2023
21 checks passed
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.

2 participants