mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
More percent sign exceptions
This commit is contained in:
parent
df6ea06f89
commit
1237ecc8f0
1 changed files with 3 additions and 3 deletions
|
@ -28,17 +28,17 @@ def check_and_fix_percent_bug(sym):
|
||||||
# The svg path for percent symbols have a known bug, so this
|
# The svg path for percent symbols have a known bug, so this
|
||||||
# checks if the symbol is (probably) a percentage sign, and
|
# checks if the symbol is (probably) a percentage sign, and
|
||||||
# splits it so that it's displayed properly.
|
# splits it so that it's displayed properly.
|
||||||
if len(sym.points) not in [315, 483] or len(sym.get_subpaths()) != 4:
|
if len(sym.points) not in [315, 324, 468, 483] or len(sym.get_subpaths()) != 4:
|
||||||
return
|
return
|
||||||
|
|
||||||
sym = sym.family_members_with_points()[0]
|
sym = sym.family_members_with_points()[0]
|
||||||
new_sym = VMobject()
|
new_sym = VMobject()
|
||||||
path_lengths = [len(path) for path in sym.get_subpaths()]
|
path_lengths = [len(path) for path in sym.get_subpaths()]
|
||||||
if len(sym.points) == 315:
|
if len(sym.points) in [315, 324]:
|
||||||
n = sum(path_lengths[:2])
|
n = sum(path_lengths[:2])
|
||||||
p1 = sym.points[:n]
|
p1 = sym.points[:n]
|
||||||
p2 = sym.points[n:]
|
p2 = sym.points[n:]
|
||||||
elif len(sym.points) == 483:
|
elif len(sym.points) in [468, 483]:
|
||||||
p1 = np.vstack([
|
p1 = np.vstack([
|
||||||
sym.points[:path_lengths[0]],
|
sym.points[:path_lengths[0]],
|
||||||
sym.points[-path_lengths[3]:]
|
sym.points[-path_lengths[3]:]
|
||||||
|
|
Loading…
Add table
Reference in a new issue