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

Fix issues in number_line.py that changes in decimal_number_config["font_size"] get rewritten by number_config #2310

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AStarySky
Copy link
Contributor

Fix the issue that changes in decimal_number_config["font_size"] get rewritten by number_config

Motivation

When working with NumberLine in manim v1.7.2, I found that the decimal number label's size doesn't change with different font_size setting.

Proposed changes

Swaping the position of self.decimal_number_config and number_config in merge_dicts_recursively.
(Which gives self.decimal_number_config a higher priority, fixing the issue.)

Test

Code:

class BugDemo(Scene):
    def construct(self):
        NumberLines = VGroup(
            NumberLine(decimal_number_config=dict(num_decimal_places=0, font_size=48), include_numbers=True),
            NumberLine(decimal_number_config=dict(num_decimal_places=0, font_size=36), include_numbers=True),
            NumberLine(decimal_number_config=dict(num_decimal_places=0, font_size=24), include_numbers=True),
            NumberLine(decimal_number_config=dict(num_decimal_places=0, font_size=12), include_numbers=True)
        ).arrange(DOWN)

        self.add(NumberLines)

Result:

Before the change:
BugDemo

After the change:
BugDemo

Fix the issue that changes in decimal_number_config["font_size"] get rewritten by number_config
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.

1 participant