Skip to content

Changed Rect edge inclusivity behavior#3253

Open
cmann1 wants to merge 7 commits into
c3lang:masterfrom
cmann1:master
Open

Changed Rect edge inclusivity behavior#3253
cmann1 wants to merge 7 commits into
c3lang:masterfrom
cmann1:master

Conversation

@cmann1
Copy link
Copy Markdown
Contributor

@cmann1 cmann1 commented May 22, 2026

contains_point is now exclusive on the maximum edge

`contains_point` is now exclusive on the maximum edge
@lerno
Copy link
Copy Markdown
Collaborator

lerno commented May 22, 2026

If so, then we don't really need the fix when adding points, right?

@cmann1
Copy link
Copy Markdown
Contributor Author

cmann1 commented May 22, 2026

You mean the changes to @ensure return.contains_point_inclusive(point)?

Since the added point could become the new maximum edge, and contain_point is now exclusive on that side, it would fail.

Comment thread lib/std/math/shapes.c3 Outdated
@return "The resulting rectangle"

@ensure return.contains_point(point)
@ensure return.contains_point_inclusive(point)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

So maybe we could make this not even a requirement and also drop the "nexhigher" part. Then have min/max with Box which is inclusive?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah I think that makes sense

@cmann1
Copy link
Copy Markdown
Contributor Author

cmann1 commented May 25, 2026

Hopefully all of that in one PR is ok.

If you do want Box instead or whatever naming convention it can be changed.

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