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

Make Rect2.encloses return true on same size #32478

Merged
merged 1 commit into from
Oct 8, 2019

Conversation

AlexHolly
Copy link
Contributor

fix #26615

func _ready():
	assert(Rect2(0,0,0,0).encloses(Rect2(0,0,0,0)))
	assert(Rect2(0,0,2,2).encloses(Rect2(0,0,2,2)))
	assert(Rect2(0,0,2,2).encloses(Rect2(1,1,1,1)))
	assert(Rect2(0,0,2,2).encloses(Rect2(1,1,0.9,0.9)))

Copy link
Member

@aaronfranke aaronfranke left a comment

Choose a reason for hiding this comment

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

This is probably a good change.

Note that the title is a bit inaccurate, in reality it changes behavior for when the end corner/edges (calculated from position+size) are in the same position, not just when the rects are the same size.

@fossegutten
Copy link
Contributor

Great! Now I can make tetris without major headaches 😂

@akien-mga akien-mga merged commit 106e21f into godotengine:master Oct 8, 2019
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rect2().encloses(Rect2()) with same rect is false
5 participants