Skip to content

Commit

Permalink
Import for both vertical and horizontal gridlines in
Browse files Browse the repository at this point in the history
  • Loading branch information
pauluhlenbruck committed Dec 11, 2023
1 parent 9a35756 commit 4f4c1c8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions manim/mobject/geometry/polygram.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,10 +617,13 @@ def __init__(
super().__init__(UR, UL, DL, DR, color=color, **kwargs)
self.stretch_to_fit_width(width)
self.stretch_to_fit_height(height)
v = self.get_vertices()
if grid_xstep is not None:

if grid_xstep or grid_ystep:
from manim.mobject.geometry.line import Line

v = self.get_vertices()

if grid_xstep:
grid_xstep = abs(grid_xstep)
count = int(width / grid_xstep)
grid = VGroup(
Expand All @@ -634,7 +637,8 @@ def __init__(
)
)
self.add(grid)
if grid_ystep is not None:

if grid_ystep:
grid_ystep = abs(grid_ystep)
count = int(height / grid_ystep)
grid = VGroup(
Expand Down

0 comments on commit 4f4c1c8

Please sign in to comment.