Temporary hack for showing text correctly

This commit is contained in:
Wallbreaker5th 2021-06-18 14:43:09 +08:00
parent 5ff8e28ba5
commit e836c3bb42
2 changed files with 7 additions and 1 deletions

View file

@ -68,6 +68,9 @@ class Text(SVGMobject):
# anti-aliasing # anti-aliasing
if self.height is None: if self.height is None:
self.scale(TEXT_MOB_SCALE_FACTOR * self.font_size) self.scale(TEXT_MOB_SCALE_FACTOR * self.font_size)
for i in self.submobjects:
i.insert_n_curves(len(i.get_points()))
def remove_empty_path(self, file_name): def remove_empty_path(self, file_name):
with open(file_name, 'r') as fpr: with open(file_name, 'r') as fpr:

View file

@ -367,6 +367,9 @@ def earclip_triangulation(verts, ring_ends):
list(range(e0, e1)) list(range(e0, e1))
for e0, e1 in zip([0, *ring_ends], ring_ends) for e0, e1 in zip([0, *ring_ends], ring_ends)
] ]
for i in rings:
verts[i[0]] += (verts[i[1]]-verts[i[0]])*5e-6
verts[i[-1]] += (verts[i[-2]]-verts[i[-1]])*5e-6
attached_rings = rings[:1] attached_rings = rings[:1]
detached_rings = rings[1:] detached_rings = rings[1:]
loop_connections = dict() loop_connections = dict()
@ -402,7 +405,7 @@ def earclip_triangulation(verts, ring_ends):
# Move the ring which j belongs to from the # Move the ring which j belongs to from the
# attached list to the detached list # attached list to the detached list
new_ring = next(filter( new_ring = next(filter(
lambda ring: ring[0] <= j < ring[-1], lambda ring: ring[0] <= j <= ring[-1],
detached_rings detached_rings
)) ))
detached_rings.remove(new_ring) detached_rings.remove(new_ring)