Skip to content

Commit d390978

Browse files
pauluhlenbruckMrDiverpre-commit-ci[bot]
authored
Fix rectangle grid properties (#3082) (#3513)
* Import for both vertical and horizontal gridlines in * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Tristan Schulz <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 9938bf5 commit d390978

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

manim/mobject/geometry/polygram.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,12 +619,16 @@ def __init__(
619619
super().__init__(UR, UL, DL, DR, color=color, **kwargs)
620620
self.stretch_to_fit_width(width)
621621
self.stretch_to_fit_height(height)
622+
622623
v = self.get_vertices()
623624
self.grid_lines = VGroup()
624625

625-
if grid_xstep is not None:
626+
if grid_xstep or grid_ystep:
626627
from manim.mobject.geometry.line import Line
627628

629+
v = self.get_vertices()
630+
631+
if grid_xstep:
628632
grid_xstep = abs(grid_xstep)
629633
count = int(width / grid_xstep)
630634
grid = VGroup(
@@ -638,7 +642,8 @@ def __init__(
638642
)
639643
)
640644
self.grid_lines.add(grid)
641-
if grid_ystep is not None:
645+
646+
if grid_ystep:
642647
grid_ystep = abs(grid_ystep)
643648
count = int(height / grid_ystep)
644649
grid = VGroup(

0 commit comments

Comments
 (0)