A rectangular box defined by a coordinate system with the origin at the top left.
| 25 | |
| 26 | @dataclass |
| 27 | class Box: |
| 28 | """A rectangular box defined by a coordinate system with the origin at the top left.""" |
| 29 | |
| 30 | type: Literal["Box"] |
| 31 | |
| 32 | x: Annotated[int, Doc("X-coordinate of the top left corner.")] |
| 33 | y: Annotated[int, Doc("Y-coordinate of the top left corner.")] |
| 34 | width: Annotated[int, Doc("Width of the box.")] |
| 35 | height: Annotated[int, Doc("Height of the box.")] |
| 36 | text: Annotated[Optional[str], Doc("Optional text centered in the box.")] = None |
| 37 | style: Annotated[Optional[Style], Doc("Optional style settings for the box.")] = None |
| 38 | |
| 39 | |
| 40 | @dataclass |