From 692a2dfd1ff121ce60946fec675412a062965d95 Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Wed, 16 May 2018 11:59:49 -0700 Subject: [PATCH] Fixed bug for multipled braces being imbalanced --- mobject/svg/tex_mobject.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mobject/svg/tex_mobject.py b/mobject/svg/tex_mobject.py index c7bcc78b..fbaf8922 100644 --- a/mobject/svg/tex_mobject.py +++ b/mobject/svg/tex_mobject.py @@ -102,10 +102,12 @@ class SingleStringTexMobject(SVGMobject): tex.count(char) for char in "{}" ] - if num_rights > num_lefts: + while num_rights > num_lefts: tex = "{" + tex - elif num_lefts > num_rights: + num_lefts += 1 + while num_lefts > num_rights: tex = tex + "}" + num_rights += 1 return tex def get_tex_string(self):