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

Reorganize inheriting order and refactor SVGMobject #1745

Merged
merged 5 commits into from
Feb 15, 2022
Merged

Reorganize inheriting order and refactor SVGMobject #1745

merged 5 commits into from
Feb 15, 2022

Conversation

YishiMichael
Copy link
Contributor

@YishiMichael YishiMichael commented Feb 15, 2022

Motivation

Fix some potential bugs left in #1731.

Proposed changes

  • M manimlib/mobject/svg/svg_mobject.py: Add svg_default dictionary to allow users to specifically fill in style attributes to elements whose style is not specified in svg scope (and the functionality of init_colors is therefore preserved); use xml.dom.ElementTree package to parse style attributes in the outer svg tag; use SVG_HASH_TO_MOB_MAP to cache svg mobjects
  • M manimlib/mobject/svg/drawings.py: Remove unnecessary init_colors override
  • M manimlib/mobject/svg/text_mobject.py: Remove unnecessary set_fill process
  • M manimlib/mobject/svg/mtex_mobject.py: Reorganize inheriting structure (MTex inherits from SVGMobject)
  • M manimlib/mobject/svg/tex_mobject.py: Reorganize inheriting structure (SingleStringTex inherits from SVGMobject)
  • M manimlib/utils/tex_file_writing.py: Avoid the message from being too long
  • M manimlib/utils/iterables.py: Add hash_obj function to hash objects that may contain dictionaries

manimlib/utils/tex_file_writing.py Outdated Show resolved Hide resolved
manimlib/mobject/svg/svg_mobject.py Outdated Show resolved Hide resolved
manimlib/utils/iterables.py Outdated Show resolved Hide resolved
@TonyCrane TonyCrane requested a review from 3b1b February 15, 2022 15:40
@3b1b
Copy link
Owner

3b1b commented Feb 15, 2022

Nice, this feels like a much more reasonable inheritance structure.

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.

4 participants