Skip to content

Line scale()/scale_ip() #170

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

Merged
merged 7 commits into from
May 22, 2023

Conversation

ScriptLineStudios
Copy link
Member

@ScriptLineStudios ScriptLineStudios commented Jan 12, 2023

Closes #145

@itzpr3d4t0r
Copy link
Member

You have to add the new functions to geometry.rst as well

@itzpr3d4t0r itzpr3d4t0r added type:new_api Adds new functionalities to the project submodule:line labels Jan 13, 2023
@itzpr3d4t0r itzpr3d4t0r changed the title Line.scale and Line.scale_ip Line scale()/scale_ip() Jan 13, 2023
Comment on lines +701 to +714
with self.assertRaises(ValueError):
line.scale_ip(0, 0.5)

with self.assertRaises(ValueError):
line.scale_ip(2, -0.1)

with self.assertRaises(ValueError):
line.scale_ip(-2, -0.5)

with self.assertRaises(ValueError):
line.scale_ip(17, 1.1)

with self.assertRaises(ValueError):
line.scale_ip(17, 10.0)
Copy link
Member

Choose a reason for hiding this comment

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

you could put these in a single for loop


with self.assertRaises(ValueError):
line.scale_ip(17, 10.0)

Copy link
Member

Choose a reason for hiding this comment

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

You should also add tests for invalid argument type, here you just have invalid values, (scroll up and you'll find similar tests for argument types)

@itzpr3d4t0r itzpr3d4t0r reopened this Feb 14, 2023
@itzpr3d4t0r itzpr3d4t0r merged commit 4bcce46 into pygame-community:main May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
submodule:line type:new_api Adds new functionalities to the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add line.scale()-scale_ip() functions
2 participants