From e55434925e9da94efbb82be36c29899a366397bc Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Sun, 15 Jan 2023 16:50:00 -0800 Subject: [PATCH] Fix get_style for null point case --- manimlib/mobject/types/vectorized_mobject.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/manimlib/mobject/types/vectorized_mobject.py b/manimlib/mobject/types/vectorized_mobject.py index 0d6b0af5..e6753f66 100644 --- a/manimlib/mobject/types/vectorized_mobject.py +++ b/manimlib/mobject/types/vectorized_mobject.py @@ -282,10 +282,11 @@ class VMobject(Mobject): return self def get_style(self): + data = self.data if self.get_num_points() > 0 else self._data_defaults return { - "fill_rgba": self.data['fill_rgba'].copy(), - "stroke_rgba": self.data['stroke_rgba'].copy(), - "stroke_width": self.data['stroke_width'].copy(), + "fill_rgba": data['fill_rgba'].copy(), + "stroke_rgba": data['stroke_rgba'].copy(), + "stroke_width": data['stroke_width'].copy(), "stroke_background": self.draw_stroke_behind_fill, "reflectiveness": self.get_reflectiveness(), "gloss": self.get_gloss(),