3b1b / 3b1b/manim

IndexError: list index out of range in text_mobject

オープン
#1,234 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
93.8k
フォーク
7.7k
PR マージ指標
PR 指標を取得中

説明

`Windows 10, Python 3.8.5, latest Manim from master branch`
```
from manimlib.imports import *

class test(Scene):
def construct(self):
t = r"""a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1 2 3 4 5 6 7 8 9 0 . : , ; ' " ( ! ? ) + - * / = ` ~ @ $ % ^ & [ ] { } _ \ | < >"""

text = Text(t, font='Arial', stroke_width=0)

self.add(text)
self.wait(.1)

Traceback (most recent call last):
File "C:\manim\manimlib\extract_scene.py", line 155, in main
scene = SceneClass(**scene_kwargs)
File "C:\manim\manimlib\scene\scene.py", line 75, in __init__
self.construct()
File "C:\test.py", line 8, in construct
text = Text(t, font='Arial', stroke_width=0)
File "C:\manim\manimlib\mobject\svg\text_mobject.py", line 67, in __init__
self.apply_space_chars()
File "C:\manim\manimlib\mobject\svg\text_mobject.py", line 162, in apply_space_chars
space.move_to(self.submobjects[char_index - 1].get_center())
IndexError: list index out of range
```
Whereas these lines work fine:
```
text = Text(t[2:], font='Arial', stroke_width=0)
text = Text(t[:-2], font='Arial', stroke_width=0)
```
It looks like `SVGMobject` cannot handle symbols like `<` and `>`. Any Ideas how to fix that?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。