Skip to content

Commit

Permalink
black ipycanvas/canvas.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Lee-Messer committed Sep 5, 2024
1 parent 20b1fc3 commit e7c8937
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ipycanvas/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -1247,18 +1247,19 @@ def close_path(self):
This method doesn't draw anything to the canvas directly. You can render the path using the stroke() or fill() methods.
"""
self._canvas_manager.send_draw_command(self, COMMANDS["closePath"])

# https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/stroke
# stroke(), stroke(path)
def stroke(self, path2d: Path2D = None):
"""Stroke (outlines) the current path with the current ``stroke_style``.
If @path2d is passed, that Path2D object will be rendered with the
If @path2d is passed, that Path2D object will be rendered with the
current ``stroke_style``"""

if isinstance(path2d, Path2D):
self._canvas_manager.send_draw_command(
self,
COMMANDS["strokePath"], [widget_serialization["to_json"](path2d, None)],
COMMANDS["strokePath"],
[widget_serialization["to_json"](path2d, None)],
)
else:
self._canvas_manager.send_draw_command(self, COMMANDS["stroke"])
Expand Down

0 comments on commit e7c8937

Please sign in to comment.