Skip to content

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

@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