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: x,y in rect changed when sprite scale to a minimum size #289

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

caohongz
Copy link

@caohongz caohongz commented Sep 30, 2024

修复:针对sprite缩放时,如缩放后的尺寸小于最小限制,会出现x和y坐标点漂移的问题。
bug_view

最终效果如下:
fixed1

fixed3.mp4

Copy link

changeset-bot bot commented Sep 30, 2024

🦋 Changeset detected

Latest commit: 14e2aed

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@webav/av-canvas Patch
@webav/av-cliper Patch
@webav/av-recorder Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@hughfenghen
Copy link
Member

@caohongz 太棒了
两个目的可以拆开吗,一个是 bugfix,一个是新功能。

最好能补充单测,
还要考虑有旋转角度缩放功能是否正常;
固定中心就当成考虑上下左右四个点的缩放是否正常。

* 值为 true 时,将固定中心点不变进行缩放
* 值为 false 时,将固定对角点不变进行缩放
*/
scaleFixedCenter = false;
Copy link
Member

Choose a reason for hiding this comment

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

建议修改命名 fixedScaleCenter, 跟 fixedAspectRatio 保持相似模式

@caohongz
Copy link
Author

@caohongz 太棒了 两个目的可以拆开吗,一个是 bugfix,一个是新功能。

最好能补充单测, 还要考虑有旋转角度缩放功能是否正常; 固定中心就当成考虑上下左右四个点的缩放是否正常。

1、有一些关联,我会尽量拆分成两个PR,如果拆分不开我会新开一个Feature的,附带修复bug;
2、可以补充单测,估计会在假期之后,见谅。

@caohongz
Copy link
Author

caohongz commented Oct 8, 2024

@caohongz 太棒了 两个目的可以拆开吗,一个是 bugfix,一个是新功能。

最好能补充单测, 还要考虑有旋转角度缩放功能是否正常; 固定中心就当成考虑上下左右四个点的缩放是否正常。

本次PR仅修复缩放bug,添加了带旋转角度的单测,后续另开PR添加新功能。

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.

3 participants