manim-chess 0.0.36__py3-none-any.whl → 0.0.38__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- manim_chess/board.py +12 -3
- {manim_chess-0.0.36.dist-info → manim_chess-0.0.38.dist-info}/METADATA +1 -1
- {manim_chess-0.0.36.dist-info → manim_chess-0.0.38.dist-info}/RECORD +5 -5
- {manim_chess-0.0.36.dist-info → manim_chess-0.0.38.dist-info}/LICENSE.txt +0 -0
- {manim_chess-0.0.36.dist-info → manim_chess-0.0.38.dist-info}/WHEEL +0 -0
manim_chess/board.py
CHANGED
@@ -58,6 +58,8 @@ class Board(Mobject):
|
|
58
58
|
Resets a square to its original color.
|
59
59
|
highlight_square(coordinate):
|
60
60
|
Highlights a square with a specific color.
|
61
|
+
clear_highlights():
|
62
|
+
Clears the highlights on the board.
|
61
63
|
get_arrow_buffer(end_position, tip_position):
|
62
64
|
Calculates buffer positions for drawing arrows.
|
63
65
|
draw_arrow(end_coordinate, tip_coordinate):
|
@@ -280,6 +282,7 @@ class Board(Mobject):
|
|
280
282
|
for coordinate in self.pieces:
|
281
283
|
self.remove(self.pieces[coordinate])
|
282
284
|
self.pieces = {}
|
285
|
+
self.clear_higlights()
|
283
286
|
|
284
287
|
def is_light_square(self, coordinate: str) -> bool:
|
285
288
|
"""
|
@@ -418,7 +421,7 @@ class Board(Mobject):
|
|
418
421
|
subtracted_position_vectors = end_position - tip_position
|
419
422
|
dir_x = subtracted_position_vectors[0]
|
420
423
|
dir_y = subtracted_position_vectors[1]
|
421
|
-
if dir_x == 0 or dir_y == 0 or abs(dir_x) == abs(dir_y):
|
424
|
+
if dir_x == 0 or dir_y == 0 or round(abs(dir_x), 1) == round(abs(dir_y), 1):
|
422
425
|
arrow = Line(stroke_width=15, stroke_opacity=.8, fill_color=ARROW_COLOR, stroke_color=ARROW_COLOR)
|
423
426
|
arrow.reset_endpoints_based_on_tip = lambda *args: None
|
424
427
|
arrow.set_points_as_corners([end_position - end_position_buffer, tip_position - tip_position_buffer])
|
@@ -478,6 +481,13 @@ class Board(Mobject):
|
|
478
481
|
for arrow in self.arrows:
|
479
482
|
self.remove(arrow)
|
480
483
|
|
484
|
+
def clear_higlights(self):
|
485
|
+
"""
|
486
|
+
Removes all highlights from the board.
|
487
|
+
"""
|
488
|
+
for coordinate in self.highlighted_squares:
|
489
|
+
self.unmark_square(coordinate)
|
490
|
+
|
481
491
|
def move_piece(self, starting_coordinate: str, ending_coordinate: str) -> None:
|
482
492
|
"""
|
483
493
|
Moves a piece from one square to another.
|
@@ -496,8 +506,7 @@ class Board(Mobject):
|
|
496
506
|
self.pieces[ending_coordinate] = piece_to_move
|
497
507
|
del self.pieces[starting_coordinate]
|
498
508
|
|
499
|
-
|
500
|
-
self.unmark_square(coordinate)
|
509
|
+
self.clear_higlights()
|
501
510
|
self.highlighted_squares = []
|
502
511
|
|
503
512
|
piece_to_move.move_to(self.squares[ending_coordinate].get_center())
|
@@ -1,5 +1,5 @@
|
|
1
1
|
manim_chess/__init__.py,sha256=SEtbIVW1Lnh-ZF4_mMYWpI-UFQLOdnGkOD7W0iqK0uc,242
|
2
|
-
manim_chess/board.py,sha256=
|
2
|
+
manim_chess/board.py,sha256=tNj2HCaxJ8hRZ9Br_Wc6XDDvWa33uG_pm3P3JjzqFYU,20477
|
3
3
|
manim_chess/evaluation_bar.py,sha256=ELjhyFPi5x_Q4Gw3U0FLVhQqN55k8rYCu-lpkru4nPo,3655
|
4
4
|
manim_chess/game_player.py,sha256=fESDu5eksZK9ic47CwQNgeq1rpkcMKt0O7_X7-E5lp0,31102
|
5
5
|
manim_chess/piece_svgs/bB.svg,sha256=d-nev6XLgFKglq_9SdXU2EIxPM1RlNWoXji4p4MYhb8,683
|
@@ -15,7 +15,7 @@ manim_chess/piece_svgs/wP.svg,sha256=BZa3zm9xUXgAtRA_SrA3DUeebWbmnBQR8nSQ0gdy6NY
|
|
15
15
|
manim_chess/piece_svgs/wQ.svg,sha256=3SCkD3QlZH7SwQ435sYe8uP3Dx9zy_xxdSy5_DbdwzU,1102
|
16
16
|
manim_chess/piece_svgs/wR.svg,sha256=6ela3ONk9djAPG3E2pqfhPVewWSyCRAtRvfm9Ycspcc,481
|
17
17
|
manim_chess/pieces.py,sha256=890HggU4vGv_PgLyUPnJj2p3ZdivoqG5BukjqsS6MeU,7634
|
18
|
-
manim_chess-0.0.
|
19
|
-
manim_chess-0.0.
|
20
|
-
manim_chess-0.0.
|
21
|
-
manim_chess-0.0.
|
18
|
+
manim_chess-0.0.38.dist-info/LICENSE.txt,sha256=B-V-3Tb7v93ub_E_3quknwdeUDtveYnceR0DcdAgolc,1067
|
19
|
+
manim_chess-0.0.38.dist-info/METADATA,sha256=rw6LsxAFo8bzi8zzNkcICDFdVq2K5Ugonat8zgtKMv0,7154
|
20
|
+
manim_chess-0.0.38.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
|
21
|
+
manim_chess-0.0.38.dist-info/RECORD,,
|
File without changes
|
File without changes
|