Skip to content
Snippets Groups Projects
Commit 2c9878e1 authored by ave's avatar ave
Browse files

docs: Document ctx.image's new options

parent 3d06ca84
No related branches found
No related tags found
No related merge requests found
try: try:
from typing import Protocol, Tuple from typing import Protocol, Tuple, Optional
except ImportError: except ImportError:
from typing_extensions import Protocol, Tuple # type: ignore from typing_extensions import Protocol, Tuple, Optional # type: ignore
class Context(Protocol): class Context(Protocol):
""" """
...@@ -301,7 +301,18 @@ class Context(Protocol): ...@@ -301,7 +301,18 @@ class Context(Protocol):
radiuses are in use. radiuses are in use.
""" """
pass pass
def image(self, path: str, x: float, y: float, w: float, h: float) -> "Context": def image(
self,
path: str,
x: float,
y: float,
w: float,
h: float,
clip_x: Optional[float] = None,
clip_y: Optional[float] = None,
clip_width: Optional[float] = None,
clip_height: Optional[float] = None,
) -> "Context":
""" """
Draw the image at path a in a rectangle with upper left coordinates at Draw the image at path a in a rectangle with upper left coordinates at
x,y which is w wide and h high. If w or h is -1 the other is set x,y which is w wide and h high. If w or h is -1 the other is set
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment