-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add scale_stroke
boolean parameter to VMobject.scale()
to allow scaling stroke_width
along with the VMobject
#3965
Add scale_stroke
boolean parameter to VMobject.scale()
to allow scaling stroke_width
along with the VMobject
#3965
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey thanks for the PR!
It seems to me that a concept of a stroke/stroke outline is only applicable to VMobject
s (Vectorized Mobjects), and doesn't make much sense in the case of an ImageMobject
for example. Can you elaborate a bit more on why you choose to override the method in Mobject
instead?
Also, it might be helpful to add a graphical unit test for this - see https://docs.manim.community/en/latest/contributing/testing.html#graphical-unit-test
…524-scale-stroke
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, looks good to me, thanks!
I left a couple of minor comments that it would be nice to fix before merging.
Thanks for the PR!
Co-authored-by: Aarush Deshpande <[email protected]>
Co-authored-by: Aarush Deshpande <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for commiting the changes suggested by Jason.
scale_stroke
boolean parameter to VMobject.scale()
to allow scaling stroke_width
along with the VMobject
Overview: What does this pull request change?
This change adds an optional boolean to
Mobject.scale(...)
, which enables outline scaling:circle.scale(0.25, scale_stroke=True)
Leading to the following changes:
(scale_stroke=False)
(scale_stroke=True)
This supports any object that has the
set_stroke(...)
method.Negative scaling does not break the stroke, however, due to the way animation is interpolated, the outline width is inconsistent in the process of negative scaling.
Motivation and Explanation: Why and how do your changes improve the library?
This closes #3525, adding the ability to scale an object outline.
This is a university-driven PR
(Same as my PR for 3863) Just for context, this PR (same as some other recent ones on this repo) is motivated by a university assignment that requires us to contribute to an Open-Source project. PR merge is not required, however. I figured this information might affect your judgment.
Reviewer Checklist