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

adjust: enhance Rect #236

Merged
merged 1 commit into from
Nov 16, 2024
Merged

Conversation

yixy-only
Copy link
Collaborator

No description provided.

@yixy-only yixy-only self-assigned this Oct 25, 2024
@yixy-only yixy-only force-pushed the adjust_enhance_rect branch from ec2d20f to 61234a1 Compare October 27, 2024 16:12
@yixy-only yixy-only requested a review from wysaid October 27, 2024 16:13
@yixy-only yixy-only marked this pull request as ready for review October 27, 2024 16:13
@yixy-only
Copy link
Collaborator Author

types.h 后面打算分离出来,放到 ege 头文件目录,供用户通过 #include <ege/types.h> 使用,目前增加了 Point, Size, Bound, Rect 四种类型(以 float 存储的 Rect 后面增加)。

  • 矩形分为两种: Bound 和 Rect,一个以边界确定区域,一个以左上角和宽高确定区域。Bound 和 Rect 两种类型能够表示的范围不同。
  • Bound 适用于确定边界和做裁剪、求交集求并集操作,但在 INT_MAX, INT_MIN 附近宽高受限。
  • Rect 适合于表示任意位置的图形, 右下边界可以超出 int 范围,但宽高无法大于 INT_MAX。并集可能会因过大而无法表示。
  • Bound 和 Rect 可通过 isOutOfRange() 判断是否能用另一种正确表示。
  • 除了Rect 和 Bound 相互转换相关的函数外,其它函数均要求矩形宽高大于 0。

@wysaid
Copy link
Owner

wysaid commented Nov 8, 2024

这个是不是不对已有功能有影响?
其他老板看看, 没问题就合入?

@yixy-only yixy-only merged commit c0462b7 into wysaid:master Nov 16, 2024
1 check passed
@yixy-only yixy-only deleted the adjust_enhance_rect branch November 16, 2024 15:19
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.

5 participants