Skip to content

Commit

Permalink
chore: update type hint of SVGMobject
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyCrane committed Feb 16, 2022
1 parent 37b5483 commit 05bee01
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions manimlib/mobject/svg/svg_mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ def handle_transform(mob: VMobject, matrix: se.Matrix) -> VMobject:
mob.shift(vec)
return mob

def get_mobject_from(self, shape: se.Shape | se.Text) -> VMobject | None:
def get_mobject_from(self, shape: se.GraphicObject) -> VMobject | None:
shape_class_to_func_map: dict[
type, Callable[[se.Shape | se.Text], VMobject]
type, Callable[[se.GraphicObject], VMobject]
] = {
se.Path: self.path_to_mobject,
se.SimpleLine: self.line_to_mobject,
Expand All @@ -196,7 +196,7 @@ def get_mobject_from(self, shape: se.Shape | se.Text) -> VMobject | None:
@staticmethod
def apply_style_to_mobject(
mob: VMobject,
shape: se.Shape | se.Text
shape: se.GraphicObject
) -> VMobject:
mob.set_style(
stroke_width=shape.stroke_width,
Expand All @@ -216,7 +216,7 @@ def line_to_mobject(self, line: se.Line) -> Line:
end=_convert_point_to_3d(line.x2, line.y2)
)

def rect_to_mobject(self, rect: se.Rect) -> Rectangle | RoundedRectangle:
def rect_to_mobject(self, rect: se.Rect) -> Rectangle:
if rect.rx == 0 or rect.ry == 0:
mob = Rectangle(
width=rect.width,
Expand Down

0 comments on commit 05bee01

Please sign in to comment.