add warning for slicing methods

This commit is contained in:
YishiMichael
2022-03-03 20:47:44 +08:00
parent 11af9508f2
commit d744311f15

View File

@ -404,9 +404,14 @@ class Text(SVGMobject):
kwargs[short_name] = kwargs.pop(long_name)
def get_parts_by_text(self, word):
if not self.apply_space_chars:
if self.is_markup:
log.warning(
"Slicing Text without applying spaces, "
"Slicing MarkupText via `get_parts_by_text`, "
"the result could be unexpected."
)
elif not self.apply_space_chars:
log.warning(
"Slicing Text without applying spaces via `get_parts_by_text`, "
"the result could be unexpected."
)
return VGroup(*(