manim-chess 0.0.35__tar.gz → 0.0.37__tar.gz

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.
Files changed (21) hide show
  1. {manim_chess-0.0.35 → manim_chess-0.0.37}/PKG-INFO +1 -1
  2. {manim_chess-0.0.35 → manim_chess-0.0.37}/manim_chess/board.py +12 -3
  3. {manim_chess-0.0.35 → manim_chess-0.0.37}/pyproject.toml +1 -1
  4. {manim_chess-0.0.35 → manim_chess-0.0.37}/LICENSE.txt +0 -0
  5. {manim_chess-0.0.35 → manim_chess-0.0.37}/README.md +0 -0
  6. {manim_chess-0.0.35 → manim_chess-0.0.37}/manim_chess/__init__.py +0 -0
  7. {manim_chess-0.0.35 → manim_chess-0.0.37}/manim_chess/evaluation_bar.py +0 -0
  8. {manim_chess-0.0.35 → manim_chess-0.0.37}/manim_chess/game_player.py +0 -0
  9. {manim_chess-0.0.35 → manim_chess-0.0.37}/manim_chess/piece_svgs/bB.svg +0 -0
  10. {manim_chess-0.0.35 → manim_chess-0.0.37}/manim_chess/piece_svgs/bK.svg +0 -0
  11. {manim_chess-0.0.35 → manim_chess-0.0.37}/manim_chess/piece_svgs/bN.svg +0 -0
  12. {manim_chess-0.0.35 → manim_chess-0.0.37}/manim_chess/piece_svgs/bP.svg +0 -0
  13. {manim_chess-0.0.35 → manim_chess-0.0.37}/manim_chess/piece_svgs/bQ.svg +0 -0
  14. {manim_chess-0.0.35 → manim_chess-0.0.37}/manim_chess/piece_svgs/bR.svg +0 -0
  15. {manim_chess-0.0.35 → manim_chess-0.0.37}/manim_chess/piece_svgs/wB.svg +0 -0
  16. {manim_chess-0.0.35 → manim_chess-0.0.37}/manim_chess/piece_svgs/wK.svg +0 -0
  17. {manim_chess-0.0.35 → manim_chess-0.0.37}/manim_chess/piece_svgs/wN.svg +0 -0
  18. {manim_chess-0.0.35 → manim_chess-0.0.37}/manim_chess/piece_svgs/wP.svg +0 -0
  19. {manim_chess-0.0.35 → manim_chess-0.0.37}/manim_chess/piece_svgs/wQ.svg +0 -0
  20. {manim_chess-0.0.35 → manim_chess-0.0.37}/manim_chess/piece_svgs/wR.svg +0 -0
  21. {manim_chess-0.0.35 → manim_chess-0.0.37}/manim_chess/pieces.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: manim-chess
3
- Version: 0.0.35
3
+ Version: 0.0.37
4
4
  Summary: A plugin for animating chessboards. Includes additional features such as PGN conversion, arrows, etc.
5
5
  Author: swoyer2
6
6
  Author-email: swoyer.logan@gmail.com
@@ -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
  """
@@ -449,7 +452,7 @@ class Board(Mobject):
449
452
  tip.move_to(tip_position + buffer_x)
450
453
  else:
451
454
  arrow0.set_points_as_corners([end_position - buffer_x, np.array([tip_position[0], end_position[1], 0])])
452
- arrow1.set_points_as_corners([np.array([tip_position[0], end_position[1]+tip_buffer, 0]), tip_position + buffer_y])
455
+ arrow1.set_points_as_corners([np.array([tip_position[0], end_position[1]-tip_buffer, 0]), tip_position + buffer_y])
453
456
  tip = arrow1.create_tip()
454
457
  tip.move_to(tip_position + buffer_y)
455
458
 
@@ -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
- for coordinate in self.highlighted_squares:
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,6 +1,6 @@
1
1
  [project]
2
2
  name = "manim-chess"
3
- version = "0.0.35"
3
+ version = "0.0.37"
4
4
  description = "A plugin for animating chessboards. Includes additional features such as PGN conversion, arrows, etc."
5
5
  authors = [
6
6
  {name = "swoyer2",email = "swoyer.logan@gmail.com"}
File without changes
File without changes